Part Number Hot Search : 
MAX485 LTC3735 FR230 VHC14F 62000 HEF45 CRG01 J012XXX
Product Description
Full Text Search
 

To Download AT75C220 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  1 features ? arm7tdmi ? arm ? thumb ? processor core  one 16-bit fixed-point oakdspcore ?  dual ethernet 10/100 mbps mac interface with voice priority  multi-layer amba ? architecture  256 x 32-bit boot rom  88k bytes of integrated fast ram  flexible external bus interface with programmable chip selects  codec interface  multi-level priority, individually-maskable, vectored interrupt controller  three 16-bit timer/counters  additional watchdog timer  two usarts with fifo and modem control lines  industry-standard serial peripheral interface (spi)  up to 24 general-purpose i/o pins  on-chip sdram controller for embedded arm7tdmi and oakdspcore  jtag debug interface  software development tools available for arm7tdmi and oakdspcore  supported by a wide range of ready-to-use application software, including multi-tasking operating system, networking and voice-processing functions  available in a 208-lead pqfp package description the AT75C220, atmel?s latest device in the family of smart internet appliance proces- sors (siap), is a high-performance processor designed for professional internet appliance applications such as the ethernet ip phone. the AT75C220 is built around an arm7tdmi microcontroller core running at 40 mips with an oakdspcore co-pro- cessor running at 60 mips and a dual ethernet 10/100 mbps mac interface. in a typical standalone ip phone, the dsp handles the voice processing functions (voice compression, acoustic echo cancellation, etc.) while the dual-port ethernet 10/100 mbps mac interface establishes the connection to the ethernet physical layer (phy) that links the network and the pc. in such an application, the power of the arm7tdmi allows it to run a voip protocol stack as well as all the system control tasks. atmel provides the AT75C220 with three levels of software modules:  a special port of the linux kernel as the proposed operating system  a comprehensive set of tunable dsp algorithms for voice processing, tailored to be run by the dsp subsystem  a broad range of application-level software modules such as h323 telephony or pop-3/smtp e-mail services smart internet appliance processor (siap ? ) AT75C220 ? cpu peripherals rev. 1396a?05/01
AT75C220 2 AT75C220 pin configuration figure 1. AT75C220 pinout in 208-lead pqfp package gnd sclka vddv3 fsa stxa srxa ntrst ma_col ma_crs ma_txer ma_txd0 ma_txd1 ma_txd2 ma_txd3 ma_txen xvddv3 ma_txclk gnd ma_rxd0 ma_rxd1 ma_rxd2 ma_rxd3 ma_rxer ma_rxclk gnd vdd2v5 ma_rxdv ma_mdc ma_mdio ma_link mb_col mb_crs gnd vdd2v5 vdd3v3 mb_txer mb_txd0 mb_txd1 mb_txd2 gnd mb_txd3 mb_txen mb_txclk mb_rxd0 mb_rxd1 mb_rxd2 mb_rxd3 mb_rxer mb_rxclk mb_rxdv mb_mdc vddv3 vdd3v3 nc vdd2v5 gnd tst irq0 fiq reset gnd vdd3v3 npcss spck mosi miso nwait vdd2v5 gnd nsoe nwr nwe3 gnd vdd3v3 nwe2 nwe1 nwe0 nce3 vdd3v3 nce2 nce1 nce0 vdd2v5 xtalin xtalout gnd pll_gnd xref240 pll_vdd2v5 gnd vdd2v5 nc gnd nc dqm1 dqm0 we nc cas ras cs1 cs0 dclk gnd gnd mb_mdio mb_link a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 vdd3v3 gnd a13 a14 a15 a16 a17 a18 a19 a20 a21 d0 d1 d2 d3 gnd d4 vdd3v3 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 vdd2v5 gnd d15 vdd3v3 gnd nreq ngnt vdd3v3 vdd3v3 b0256 gnd dbw32 vdd3v3 pb9 pb8/nce2 pb7/nce1 pb6/nwdovf pb5/nria pb4 pb3/nctsa pb2/tiob1 pb1/tioa1 pb0/tclk1 gnd txdb rxdb ndcda ndsra ndtra nctsa nrtsa txda rxda gnd pa0/oakain0 pa1/oakain1 pa2/oakaout0 pa3/oakaout1 pa4 pa5 nc vdd3v3 pa6 pa7 pa8/tclk0 pa9/tioa0 pa10/tiob0 pa11/scka vdd3v3 gnd pa12/npcs1 gnd vdd2v5 pa19/aclk tck tms tdi tdo vdd3v3 gnd 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 156 155 154 153 152 151 150 149 148 147 146 145 144 143 142 141 140 139 138 137 136 135 134 133 132 131 130 129 128 127 126 125 124 123 122 121 120 119 118 117 116 115 114 113 112 111 110 109 108 107 106 105 208 207 206 205 204 203 202 201 200 199 198 197 196 195 194 193 192 191 190 189 188 187 186 185 184 183 182 181 180 179 178 177 176 175 174 173 172 171 170 169 168 167 166 165 164 163 162 161 160 159 158 157 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
AT75C220 3 pin description table 1. AT75C220 pin description list block pin name function type common bus a[21:0] address bus output d[15:0] data bus input/output nreq bus request input ngnt bus grant output synchronous dynamic memory controller dclk sdram clock output dqm[1:0] sdram byte masks output cs0 sdram chip select 0 output cs1 sdram chip select 1 output ras row address strobes output cas column address strobes output we sdram write enable output static memory controller nce0, nce3 chip selects output nwe[1:0] byte select/write enable output nsoe output enable output nwr memory block write enable output nwait enable wait states input i/o port a pa[12:0] general-purpose i/o lines. multiplexed with peripheral i/os. input/output pa[19] general-purpose i/o line. multiplexed with peripheral i/os. input/output i/o port b pb[9:0] general-purpose i/o lines. multiplexed with peripheral i/os. input/output dsp subsystem oakain[1:0] oakdspcore user input input oakaout[1:0] oakdspcore user output output timer/counter 0 tclk0 timer 0 external clock input tioa0 timer 0 signal a input/output tiob0 timer 0 signal b input/output timer/counter 1 tclk1 timer 1 external clock input tioa1 timer 1 signal a input/output tiob1 timer 1 signal b input/output watchdog nwdovf watchdog overflow output
AT75C220 4 serial peripheral interface miso master in/slave out input/output mosi master out/slave in input/output spck serial clock input/output npcss chip select/slave select input/output npcs1 optional spi chip select 1 output usart a rxda receive data input txda transmit data output nrtsa ready to send output nctsa clear to send input ndtra data terminal ready output ndsra/bootn data set ready input ndcda data carrier detect input usart b rxdb receive data input txdb transmit data output jtag interface ntrst test reset input tck test clock input tms test mode select input tdi test data input input tdo test data output output codec interface sclka serial clock input/output fsa frame pulse input/output stxa transmit data to codec input srxa receive data to codec output mac a interface ma_col mac a collision detect input ma_crs mac a carrier sense input ma_txer mac a transmit error output ma_txd[3:0] mac a transmit data bus output ma_txen mac a transmit enable output ma_txclk mac a transmit clock input ma_rxd[3:0] mac a receive data bus input ma_rxer mac a receive error input ma_rxclk mac a receive clock input ma_rxdv mac a receive data valid output ma_mdc mac a management data clock output ma_mdio mac a management data bus input/output ma_link mac a link interrupt input table 1. AT75C220 pin description list (continued) block pin name function type
AT75C220 5 mac b interface mb_col mac b collision detect input mb_crs mac b carrier sense input mb_txer mac b transmit error output mb_txd[3:0] mac b transmit data bus output mb_txen mac b transmit enable output mb_txclk mac b transmit clock input mb_rxd[3:0] mac b receive data bus input mb_rxer mac b receive error input mb_rxclk mac b receive clock input mb_rxdv mac b receive data valid output mb_mdc mac b management data clock output mb_mdio mac b management data bus input/output mb_link mac b link interrupt input miscellaneous reset power on reset input fiq/lowp fast interrupt/low power input irq0 external interrupt requests input xref240 external 240 mhz pll reference input xtalin external crystal input input xtalout external crystal ouptut output tst test mode input b0256 package size option (1 = 256 pins) input dbw32 external data bus width for cs0 (1 = 32 bits) input table 1. AT75C220 pin description list (continued) block pin name function type
AT75C220 6 figure 2. AT75C220 block diagram irq controller spi timer/counter 0 timer/counter 1 timer/counter 2 amba bridge peripheral data controller oakdspcore dsp subsystem arm7tdmi core embedded ice apb asb usart a usart b external bus interface sdram controller sram controller clocks reset boot rom pio a pio b jtag watchdog timer dual ethernet 10/100 mbps mac interface
AT75C220 7 figure 3. dsp subsystem block diagram figure 4. application example ? standalone ethernet telephone 24k x 16 program ram oakdspcore 16k x 16 general- purpose ram 256 x 16 dual-port mailbox on-chip emulation module 2k x 16 x-ram 2k x 16 y-ram codec interface bus interface unit dsp subsystem asb oak program bus oak data bus volp protocol stack arm7tdmi core external bus interface sdram controller sram controller sdram flash speaker phone interface voice codec voice processing dsp subsystem analog front end AT75C220 keyboard screen speaker microphone handset dual-port ethernet 10/100 mbps mac interface ethernet 10/100 mbps phy ethernet 10/100 mbps phy network pc
AT75C220 8 architectural overview the AT75C220 integrates an embedded arm7tdmi pro- cessor. external sdram and sram/flash interfaces are provided so that processor code and data may be stored off-chip. the AT75C220 architecture consists of two main buses, the advanced system bus (asb) and the advanced peripheral bus (apb). the asb is designed for maximum performance. it inter- faces the processor with the on-chip dsp subsystem and the external memories and devices by the means of the external bus interface (ebi). the apb is designed for access to on-chip peripherals and is optimized for low power consumption. the amba bridge provides an interface between the asb and apb. the AT75C220 uses a multi-layer amba bus:  it integrates two independent amba asb buses. the two buses are connected by a bridge that is not visible to the other devices on the bus.  the primary bus (arm bus) is the main processor bus to which most peripherals are connected.  the secondary bus (mac bus) is used exclusively for ethernet traffic. the arm7tdmi, usart dma and asb-asb bridge devices are masters on the arm asb bus, the mac dma and asb-asb bridge are masters on the mac asb bus and the flash/sram and sdram interfaces are asb slaves. for more details on bus arbitration, see ? arbitration using multi-layer amba ? on page 31. all the peripherals are accessed by means of the apb bus. an on-chip peripheral data controller (pdc) transfers data between the on-chip usarts and the memories without processor intervention. most importantly, the pdc removes the processor input-handling overhead and significantly reduces the number of clocks required for data transfer. it can transfer up to 64k contiguous bytes without reprogram- ming the starting address. as a result, the performance of the microcontroller is increased and power consumption reduced. the AT75C220 peripherals are designed to be pro- grammed with a minimum number of instructions. each peripheral has 16k bytes of address space allocated in the upper part of the address space. the peripheral register set is composed of control, mode, data, status and interrupt registers. to maximize the efficiency of bit manipulation, frequently- written registers are mapped into three memory locations. the first address is used to set the individual register bits, the second resets the bit and the third address reads the value stored in the register. a bit can be set or reset by writ- ing a one to the corresponding position at the appropriate address. writing a zero has no effect. individual bits can thus be modified without having to use costly read-modify- write and complex bit-manipulation instructions and without having to store-disable-restore the interrupt state. all of the external signals of the on-chip peripherals are under the control of the parallel i/o controllers. the pio controllers can be programmed to insert an input filter on each pin or generate an interrupt on a signal change. after reset, the user must carefully program the pio controllers in order to define which peripherals are connected with off- chip logic. the arm7tdmi processor operates in little-endian mode in the AT75C220. the processor's internal architecture and the arm and thumb instruction sets are described in the arm7tdmi datasheet, literature number 0673. the mem- ory map and the on-chip peripherals are described in this datasheet. peripheral data controller the AT75C220 has a four-channel peripheral data control- ler (pdc) dedicated to the two on-chip usarts. one pdc channel is connected to the receiving channel and one to the transmitting channel of each usart. the user interface of a pdc channel is integrated in the memory space of each usart channel. it contains a 32-bit address pointer register and a 16-bit count register. when the programmed number of bytes is transferred, an end-of- transfer interrupt is generated by the corresponding usart. for more details on pdc operation and program- ming, see the section describing the usart on page 74 .
AT75C220 9 memory map the memory map is divided into regions of 256 megabytes. the top memory region (0xf000_0000) is reserved and subdivided for internal memory blocks or peripherals within the AT75C220. the device can define up to six other active external memory regions by means of the static memory controller and sdram memory controller. see table 2. the memory map is divided between the two asb buses. all regions except the 16 megabytes between 0xfb00_0000 and 0xfbff_ffff are located on the arm asb bus. accesses to locations between 0xfb00_0000 and 0xfbff_ffff are routed to the mac asb bus. the memory map assumes default values on reset. exter- nal memory regions can be reprogrammed to other base addresses. for details, see ? smc: static memory control- ler ? on page 16 and ? sdmc: sdram controller ? on page 24. note that the internal memory regions have fixed loca- tions that cannot be reprogrammed. there are no hardware locks to prevent incorrect program- ming of the regions. programming two or more regions to have the same base address results in undefined behavior. the arm reset vector with address 0x00000000 is mapped to internal rom or external memory depending on the sig- nal pin ndsra/bootn. after booting, the rom region can be disabled and some external memory such as sdram or flash can be mapped to the bottom of the memory map by programming smc_cs0 or dmc_mr0. table 2. AT75C220 memory map default base address region type normal mode boot mode 0xff000000 internal apb bridge 0xfe000000 internal reserved 0xfd000000 internal oak a program ram (24k x 16 bits) 0xfc000000 frame buffer (16k x 16 bits) 0xfb000000 internal reserved (mac asb bus) 0xfa000000 internal oak a dpmb (256 x 16 bits) 0xf9000000 internal boot rom (1 kb) 0x50000000 external sdmc_cs1 0x40000000 external sdmc_cs0 0x30000000 external smc_cs3 0x20000000 external smc_cs2 0x10000000 external smc_cs1 0x00000000 external/internal smc_cs0 boot rom 0x000003ff 0x00000000
AT75C220 10 peripheral memory map the register maps for each peripheral are described in the corresponding section of this datasheet. the peripheral memory map has 16k bytes reserved for each peripheral. initialization reset initializes the user interface registers to their default states as defined in the peripheral sections of this datasheet and forces the arm7tdmi to perform the next instruction fetch from address zero. except for the program counter, the arm core registers do not have defined reset states. when reset is active, the inputs of the AT75C220 must be held at valid logic levels. there are three ways in which the AT75C220 can enter reset: 1. hardware reset. caused by asserting the reset pin, e.g., at power-up. 2. watchdog timer reset. the wd timer can be pro- grammed so that if timed out, a pulse is generated that forces a chip reset. 3. software reset. there are two software resets which are asserted by writing to bits [11:10] of the siap mode register. siap_md[11] forces a software reset with rm set low and siap_md[10] forces a reset with rm set high. reset pin the reset pin should be asserted for a minimum of 10 clock cycles. however, if external dram is fitted, then reset should be applied for the time interval specified by the sdram datasheet, typically 200 s. the oakdspcores are only released from reset by the arm program control. when reset is released, the pin ndsra/bootn is sam- pled to determine if the arm should boot from internal rom or from external memory connected to ncs0. the details of this boot operation are described in the section ? boot mode ? on page 11. processor synchronization the arm and the oakdspcore processors have their own plls and at power-on each processor has its own indeter- minate lock period. to guarantee proper synchronization of inter-processor communication through the mailboxes, a specific reset sequence should be followed. once the arm core is out of reset, it should set and clear the reset line of the oakdspcore three times. this guaran- tees message synchronization between the arm and the oakdspcore. table 3. AT75C220 peripheral memory map base address (normal mode) peripheral description 0xff000000 mode AT75C220 mode controller 0xff004000 smc static memory controller 0xff008000 sdmc sdram controller 0xff00c000 pioa programmable i/o 0xff010000 pio b keypad pio 0xff014000 tc timer/counter channels 0xff018000 usarta usart 0xff01c000 usartb usart 0xff020000 spi serial peripheral interface 0xff024000 reserved 0xff028000 wdt watchdog timer 0xff030000 aic interrupt controller 0xff034000 maca mac ethernet 0xff038000 macb mac ethernet 0xfffff000 aic (alias) interrupt controller
AT75C220 11 clocking the AT75C220 mode register controls clock generation. oscillator and pll the AT75C220 uses an external 16 mhz crystal (xclk) and an on-chip pll to generate the internal clocks. the pll generates a 240 mhz clock that is divided down to pro- duce the arm clock and oak clock. arm system clock the arm subsystem runs at 40 mhz. oak system clock the oak subsystem runs at 60mhz. other clocks the codec interfaces run from 800 khz that is seperate from the oak clock. the usarts and timers operate from divided arm clocks. figure 5. AT75C220 clocking boot mode the AT75C220 has an integrated 1-kbyte rom to support the boot software. when the device is released from reset, the arm starts fetching from address 0x00000000. if the rm flag in the siap-e mode register (siap_md on page 12) is low, the internal boot rom is mapped to the bottom 1k byte of the memory map. if rm is high, the bottom 16m bytes of memory address will default to external memory region 0. if ndsra/bootn is asserted on reset, the internal boot rom program is executed. the boot program reads data from usart a and writes it to the oak program ram (in the arm memory map whereas the oak is in reset). the downloaded software can then configure the various con- trol registers in the AT75C220 and its peripherals so as to perform external memory accesses. this allows the flash to be written. the boot rom code:  sets cts active  waits for approximately three seconds for the start of a flash download sequence from the usart. if the special header is not received, the AT75C220 boots normally, i.e., from external memory at 0x00000000. if the special header is received, the boot rom enters the code download process. table 4. clock source and frequency source frequency comment crystal 16 mhz external crystal pll output 240 mhz crystal multiplied by 15 arm clock 40 mhz pll divided by 6 oak clock 60 mhz pll divided by 4 10 pf xtalout 1 m ? 16 mhz xtal 10 pf xtalin oscillator 16 mhz 100 ? 10 nf xref 240f pll . . 4 phase generator 40 mhz 40 mhz arm core clock dsp subsystem clock . . 15 240 mhz . . 6 60 mhz
AT75C220 12 AT75C220 mode controller the arm configures the mode of the AT75C220 by means of the siap-e mode controller. the siap-e mode controller is a memory-mapped periph- eral that sits on the apb bus. register map base address: 0xff000000 note: 1. if the pkg flag is set, the reset value is 0x00010220 since the AT75C220 is bonded in large bond-out mode. siap-e mode register register name: siap_md access: read/write reset value: 0x00b0342  rm: remap on reset being released this flag is set to the value of ndsra/bootn. when rm is active low the boot rom is mapped to location 0x00000000. subsequently, this flag can be set high by software so that the rom mapping is dis- abled and another memory controller region (e.g. flash) is mapped to location 0x00000000.  ra: oaka reset this flag resets to active low so that the oaka is held in reset. the oaka is be released from reset by asserting this flag high.  ia: inhibit oaka clock this flag resets to active low so that the oaka clock is enabled. the oaka clock is be inhibited by asserting this flag high.  lp: low power mode on reset this field is high. when written high the pll is disabled and the arm and oak cores and logic are clocked at the low power clock frequency. note, in this mode the arm and oak are clocked at the same frequency determined by the lpcs field. when lp is written low the pll is enabled and once it has locked the clock is switched over to the nor- mal operating frequency. table 5. AT75C220 register map register address register name description access reset value 0x0 siap_md siap-e mode register read/write 0x00b0340 0x4 siap_id siap-e id register read-only 0x0000220 (1) 0x8 siap_rst siap-e reset status register read/write 0x0000001 0xc siap_clkf siap-e clock status register read-only 0x0000001 31 30 29 28 27 26 25 24 ?? jcidbg outdiv indiv 23 22 21 20 19 18 17 16 icp ipoltst 15 14 13 12 11 10 9 8 ? cra ? dba sw2 sw1 lpcs 76543210 sa lp ?? ia ? ra rm
AT75C220 13  sa: slow arm mode on reset this field is low. in normal operating mode, if bit sa is set. the arm clock is 34mhz (i.e. the pll value is divided by 7). if sa is not set the arm clock is 40mhz (i..e the pll divisor is 6). sa can be switched during low power mode but should not be changed when lp is low.  lpcs: low power clock select this field is used to select a slower clock frequency for the arm system clock as per the table below.  sw1: software reset 1 writing a 1 to this bit forces the siap into reset with rm set to 0.  sw2: software reset 2 writing a 1 to this bit forces the siap into reset with rm set to 1.  dba: oaka debug mode this flag resets low. to enter oaka debug mode (specific pins are multiplexed out on functional pins), this bit should be set.  cra: codeca reset this flag resets to active low so that the codeca is held in reset. the codeca is released from reset by asserting this flag high.  ipoltst: pll bias adjustment this can be used to tune the pll if the bias current is not correct after manufacture.  icp: pll charge pump current this can be used to tune the pll if it does not function with the default current of 2.5 a.  indiv input frequency range of pll. lpcs oscillator clock divisor arm and oak system clock 00 1 8 mhz 0 1 16 1 mhz 1 0 64 250 khz 1 1 512 32 khz bias factor 15 ipoltst ? () 4 ? = iicp ( 1 ) + 2.5 a = indiv pll input frequency range 0 0 5 khz to 40 mhz 0 1 40 mhz to 80 mhz 1 0 80 mhz to 160 mhz 1 1 160 mhz to 250 mhz
AT75C220 14  outdiv output frequency range of pll.  jcidbg this field controls the mode of the jci. the oak subsystem has its own jtag port. this port is used to communicate serially with the oak ocem module. siap-e id register register name: siap_id access: read-only reset value: 0x00000220 in small bond-out mode 0x0001220 in large bond-out mode  ident: identifier this field indicates the device identifier 0x0220.  pkg: package this bit reflects the state of the data bus width signal dbw and indicates the siap package size. outdiv pll output frequency range 0 0 40 mhz to 250 mhz 0 1 20 mhz to 40 mhz 1 0 10 mhz to 20 mhz 1 1 5 mhz to 10 mhz 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ??????? pkg 15 14 13 12 11 10 9 8 ident 76543210 ident
AT75C220 15 siap-e reset status register register name: siap_rst access: read/write reset value: 0x00000001  rst[2:0]: reset these bits indicate the cause of the last reset. siap-e clock status register register name: siap_clkf access: read-only reset value: 0x00000001  clk: clock status this bit indicates which clock is in use by the system. when set, the low power clock is in use. when cleared, the pll is locked and the high power clock is in use. this can be used by software to determine when the power mode has changed after the lp bit has been written. 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ???????? 76543210 ????? rst rst rst rst reset event 0 0 1 hardware 0 1 0 watchdog timer 100 software 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ???????? 76543210 ??????? clk
AT75C220 16 external bus interface the external bus interface (ebi) generates the signals which control access to external memories or peripheral devices. smc: static memory controller the static memory controller (smc) is used by the AT75C220 to access external static memory devices. static memory devices include external flash, sram or peripherals. the smc provides a glueless memory interface to external memory using the common address and data bus and some dedicated control signals. the smc is highly pro- grammable and has up to 24 bits of address bus, a 32- or 16-bit data bus and up to four chip select lines. the smc supports different access protocols allowing single clock- cycle accesses. the smc is programmed as an internal peripheral that has a standard apb bus interface and a set of memory-mapped registers. the smc shares the exter- nal address and data buses with the dmc and any external bus master. external memory mapping the memory map associates the internal 32-bit address space with the external 24-bit address bus. the memory map is defined by programming the base address and page size of the external memories. note that a[2:23] is only significant for 32-bit memory and a[1:23] for 16-bit memory. if the physical memory-mapped device is smaller than the programmed page size, it wraps around and appears to be repeated within the page. the smc correctly handles any valid access to the memory device within the page. in the event of an access request to an address outside any programmed page, an abort signal is generated by the internal decoder. two types of abort are possible: instruc- tion prefetch abort and data abort. the corresponding exception vector addresses are 0x0000000c and 0x00000010. it is up to the system programmer to program the exception handling routine used in case of an abort. if the AT75C220 is in internal boot mode, any chip select configured with a base address of zero will be disabled as the internal rom is mapped to address zero. data bus width a data bus width of 32 or 16 bits can be selected for each chip select. this option is controlled by the dbw field in the chip select register (smc_csr) of the corresponding chip select. the AT75C220 always boots up with a data bus width of 16 bits set in smc_csr0. byte-write or byte-select mode each chip select with a 32-/16-bit data bus operates with one or two different types of write mode: 1. byte-write mode supports four (32-bit bus) or two (16-bit bus) byte writes and a single read signal. 2. byte-select mode selects the appropriate byte(s) using four (32-bit bus) or two (16-bit bus) byte-select lines and separate read and write signals. this option is controlled by the bat field in smc_csr for the corresponding chip select. byte-write access can be used to connect four 8-bit devices as a 32-bit memory page or two 8-bit devices as a 16-bit memory page. table 6. signal interface fpdram description type notes a[23:0] address bus output d[31:0] data bus i/o d[15:0] used when data bus width is 16 nce[3:0] active low chip enables output nce[3] can be configured for lcd interface mode nwe[3:0] active low byte select/write strobe signals output nwr active low write strobe signals output nsoe active low read enable signal output nwait active low wait signal input
AT75C220 17 for a 32-bit bus:  the signal nwe0 is used as the write enable signal for byte 0.  the signal nwe1 is used as the write enable signal for byte 1.  the signal nwe2 is used as the write enable signal for byte 2.  the signal nwe3 is used as the write enable signal for byte 3.  the signal nsoe enables memory reads to all memory blocks. for a 16-bit bus:  the signal nwe0 is used as the write enable signal for byte 0.  the signal nwe1 is used as the write enable signal for byte 1.  the signal nsoe enables memory reads to all memory blocks. byte-select mode can be used to connect one 32-bit device or two 16-bit devices in a 32-bit memory page or one 16-bit device in a 16-bit memory page. for a 32-bit bus:  the signal nwe0 is used to select byte 0 for read and write operations.  the signal nwe1 is used to select byte 1 for read and write operations.  the signal nwe2 is used to select byte 2 for read and write operations.  the signal nwe3 is used to select byte 3 for read and write operations.  the signal nwr is used as the write enable signal for the memory block.  the signal nsoe enables memory reads to the memory block. for a 16-bit bus:  the signal nwe0 is used to select byte 0 for read and write operations.  the signal nwe1 is used to select byte 1 for read and write operations.  the signal nwr is used as the write enable signal for the memory block.  the signal nsoe enables memory reads to the memory block. during boot, the number of external devices (number of active chip selects) and their configurations must be pro- grammed as required. the chip select addresses that are programmed take effect immediately. wait states also take effect immediately when they are programmed to optimize boot program execution. read protocols the smc provides two alternative protocols for external memory read access: standard and early read. the differ- ence between the two protocols lies in the timing of the nsoe (read cycle) waveform. the protocol is selected by the drp field in the memory control register (smc_mcr) and is valid for all memory devices. standard read protocol is the default protocol after reset.  standard read protocol standard read protocol implements a read cycle in which nsoe and the write strobes are similar. both are active during the second half of the clock cycle. the first half of the clock cycle allows time to ensure completion of the pre- vious access, as well as the output of address and nce before the read cycle begins. during a standard read protocol external memory access, nce is set low and addr is valid at the beginning of the access, whereas nsoe goes low only in the second half of the master clock cycle to avoid bus conflict. the write strobes are the same in both protocols. the write strobes always go low in the second half of the master clock cycle.  early read protocol early read protocol provides more time for a read access from the memory by asserting nsoe at the beginning of the clock cycle. in the case of successive read cycles in the same memory, nsoe remains active continuously. since a read cycle normally limits the speed of operation of the external memory system, early read protocol allows a faster clock frequency to be used. however, an extra wait state is required in some cases to avoid contention on the external bus. in early read protocol, an early read wait state is automati- cally inserted when an external write cycle is followed by a read cycle to allow time for the write cycle to end before the subsequent read cycle begins. this wait state is generated in addition to any other programmed wait states (i.e., data float wait). no wait state is added when a read cycle is fol- lowed by a write cycle, between consecutive accesses of the same type or between external and internal memory accesses. early read wait states affect the external bus only. they do not affect internal bus timing. write protocol during a write cycle, the data becomes valid after the fall- ing edge of the write strobe signal and remains valid after the rising edge of the write strobe. the external write strobe waveform on the appropriate write strobe pin is used to control the output data timing to guarantee this operation. thus, it is necessary to avoid excessive loading of the write strobe pins, which could delay the write signal too long and cause a contention with a subsequent read cycle in stan- dard protocol. in early read protocol, the data can remain
AT75C220 18 valid longer than in standard read protocol due to the addi- tional wait cycle that follows a write access. wait states the smc can automatically insert wait states. the different types of wait states are:  standard wait states  data float wait states  external wait states  chip select change wait states  early read wait states (see ? read protocols ? on page 17 for details)  standard wait states each chip select can be programmed to insert one or more wait states during an access on the corresponding device. this is done by setting the wse field in the corresponding smc_csr. the number of cycles to insert is programmed in the nws field in the same register. the correspondence between the number of standard wait states programmed and the number of cycles during which the write strobe pulse is held low is found in table 7. for each additional wait state programmed, an additional cycle is added.  data float wait state some memory devices are slow to release the external bus. for such devices it is necessary to add wait states (data float waits) after a read access before starting a write access or a read access to a different external memory. the data float output time (tdf) for each external mem- ory device is programmed in the tdf field of the smc_csr register for the corresponding chip select. the value (0 - 7 clock cycles) indicates the number of data float waits to be inserted and represents the time allowed for the data output to go high impedance after the memory is dis- abled. the smc keeps track of the programmed external data float time even when it makes internal accesses to ensure that the external memory system is not accessed while it is still busy. internal memory accesses and consecutive accesses to the same external memory do not have added data float wait states. when data float wait states are being used, the smc pre- vents the dmc or external master from accessing the external data bus.  external wait the nwait input can be used to add wait states at any time nwait is active low and is detected on the rising edge of the clock. if nwait is low at the rising edge of the clock, the smc adds a wait state and does not change the output signals.  chip select change wait states a chip select wait state is automatically inserted when con- secutive accesses are made to two different external mem- ories (if no wait states have already been inserted). if any wait states have already been inserted (e.g., data float wait), then none are added. lcd interface mode nce3 can be configured for use with an external lcd con- troller by setting the lcd bit in the smc_csr3 register. additionally, wse must be set and nws programmed with a value of one or more. in lcd mode, nce3 is shortened by one-half clock cycle at the leading and trailing edges, providing positive address setup and hold. for read cycles, the data is latched in the smc as nce3 is raised at the end of the access. table 7. correspondence wait states/number of cycles wait states cycles 01/2 11
AT75C220 19 smc register map the smc is programmed using the registers listed in the table 8. the memory control register (smc_mcr) is used to program the number of active chip selects and data read protocol. four chip select registers (smc_csr0 to smc_csr3) are used to program the parameters for the individual external memories. each smc_csr must be programmed with a different base address, even for unused chip selects. the AT75C220 resets such that smc_csr0 is configured as having a 16-bit data bus. smc chip select register register name: smc_csr0..smc_csr3 access: read/write reset value:  dbw: data bus width table 8. smc register map offset register name description access reset value 0x00 smc_csr0 chip select register read/write 0x0000203d 0x04 smc_csr1 chip select register read/write 0x10000000 0x08 smc_csr2 chip select register read/write 0x20000000 0x0c smc_csr3 chip select register read/write 0x30000000 0x10 ? reserved ?? 0x14 ? reserved ?? 0x18 ? reserved ?? 0x1c ? reserved ?? 0x20 ? reserved ?? 0x24 smc_mcr memory control register read/ write 0 31 30 29 28 27 26 25 24 ba 23 22 21 20 19 18 17 16 ba ??? lcd 15 14 13 12 11 10 9 8 ?? csen bat tdf pages 76543210 pages mws wse nws dbw dbw data bus width 00reserved 0 1 16-bit external bus 1 0 32-bit external bus 11reserved
AT75C220 20  nws: number of wait states this field is valid only if wse is set.  wse: wait state enable  mws: multiply wait states see table 9, where  pages: page size  tdf: data float output time  bat: byte access mode 0 = byte write mode 1 = byte select mode table 9. nws, wse values nws wse wait states xx x 0 0 0001 1 0011 2 0101 3 0111 4 1001 5 1011 6 1101 7 1111 8 pages page size base address 0 0 1m byte ba[31 - 20] 0 1 4m bytes ba[31 - 22] 1 0 16m bytes ba[31 - 24] 11 reserved ? tdf cycles after transfer 00 0 0 00 1 1 01 0 2 01 1 3 10 0 4 10 1 5 11 0 6 11 1 7 ws nws 1 + () 81 + =
AT75C220 21  csen: chip select enable active high.  lcd: lcd mode enable active high. smc_csr3 only.  ba: base address this field contains the high-order bits of the base address. if the page size is larger than 1m byte, then the unused bits of the base address are ignored by the smc decoder. smc memory control register register name: smc_mcr  drp: data read protocol 0 = standard read mode 1 = early read mode 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ???????? 76543210 ??? drp ????
AT75C220 22 switching waveforms figure 6 shows a write to memory 0 followed by a write and a read to memory 1. smc_csr0 is programmed for one wait state with bat = 0 and dft = 0. smc_csr1 is pro- grammed for zero wait states with bat = 1 and dft = 0. smc_mcr is programmed for early reads from all memories. the write to memory 0 is a word access and therefore all four nwe strobes are active. as bat = 0, they are config- ured as write strobes and have the same timing as nwr. as the access employs a single wait state, the write strobe pulse is one clock cycle long. there is a chip select change wait state between the mem- ory 0 write and the memory 1 write. the new address is output at the end of the memory 0 access, but the strobes are delayed for one clock cycle. the write to memory 1 is a half-word access to an odd half- word address and, therefore, nwe2 and nwe3 are active. as bat = 1, they are configured as byte select signals and have the same timing as nce. as the access has no inter- nal wait states, the write strobe pulse is one- half clock cycle long. data and address are driven until the write strobe rising edge is sensed at the siap pin to guarantee positive hold times. there is an early read wait state between memory 1 write and memory 1 read to provide time for the AT75C220 to disable the output data before the memory is read. if the read was normal mode, i.e., not early, the nsoe strobe would not fall until the rising edge of bclk and no wait state would be inserted. if the write and early read were to different memories, then the early read wait state is not required as a chip select wait state will be implemented. the read from memory 1 is a byte access to an address with a byte offset of 2 and therefore only nwe2 is active. figure 6. write to memory 0, write and read to memory 1 bclk nce0 nce1 a nwr nsoe nwe0 nwe1 nwe2 nwe3 d (siap) d (mem) internal wait state chip select wait state early read wait state
AT75C220 23 figure 7 shows a write and a read to memory 0 followed by a read and a write to memory 1. smc_csr0 is pro- grammed for zero wait states with bat = 0 and dft = 0. smc_csr1 is programmed for zero wait states with bat = 1 and dft = 1. smc_mcr is programmed for normal reads from all memories the write to memory 0 is a byte access and, therefore, only one nwe strobe is active. as bat = 0, they are configured as write strobes and have the same timing as nwr. the memory 0 read immediately follows the write as early reads are not configured and an early read wait state is not required. as early reads are not configured, the read strobe pulse is one-half clock cycle long. there is a chip select change wait state between the mem- ory 0 write and the memory 1 read. the new address is output at the end of the memory 0 access but the strobes are delayed for one clock cycle. the write to memory 1 is a half-word access to an odd half- word address and, therefore, nwe2 and nwe3 are active. as bat = 1, they are configured as byte select signals and have the same timing as nce. as dft = 1 for memory 1, a wait state is implemented between the read and write to provide time for the memory to stop driving the data bus. dft wait states are only imple- mented at the end of read accesses. the read from memory 1 is a byte access to an address with a byte offset of 2 and, therefore, only nwe2 is active. figure 7. write and read to memory 0, read and write to memory 1 bclk nce0 nce1 a nwr nsoe nwe0 nwe1 nwe2 nwe3 d (siap) d (mem) chip select wait state data float wait state
AT75C220 24 sdmc: sdram controller the AT75C220 integrates an sdram controller (sdmc). the arm accesses external sdram by means of the sdram memory controller. the sdmc shares the same address and data pins as the static memory controller but has separate control signals. the sdmc interface is a memory-mapped apb slave. for very low frequency selection in low power mode, the sdram should be refreshed frequently. main features of the sdmc are:  external memory mapping  up to 4 chip select lines  32- or 16-bit data bus  byte write or byte select lines  two different read protocols  programmable wait state generation  external wait request  programmable data float time  programmable burst mode the signals ras, cas, we, a[21:0], and d[15:0] have functions similar to those of a conventional dram. dclk is the free-running, normally continuous clock to which all other signals are synchronized; cke is an enable signal that gates the other control inputs. note that cke is not bonded out since it is always active high. apb interface the sdmc interface is a memory-mapped apb slave. asb interface the sdmc is also an asb slave and has a reserved mem- ory region in the asb memory map. read and write bursts the sdmc has been modified so read accesses are per- formed in bursts of four for accesses to 32-bit memory or bursts of eight for 32-bit access to 16-bit memory. read accesses are performed as shown in figure 8, figure 9 and figure 10. note that read bursts are terminated if a non-sequential access is detected. however, pipelined commands from the sdram may be still be executed but the resultant read data is ignored. three separate read accesses are shown in figure 8, fig- ure 9 and figure 10. in figure 8, the data from all four reads is used, in figure 9 the data from the last two reads is discarded. figure 10 shows a single non-sequential access to a new row. table 10. external memory interface signal name type description dclk output sdram clock a[21:0] output memory address (shared with smc) d[15:0] input memory data input (shared with smc) dqm[1:0] output sdram byte masks cs0 output sdram chip select, active low cs1 output sdram chip select, active high we output sdram write enable, active low ras output row address select, active low cas output column address select, active low
AT75C220 25 figure 8. read with burst length of 4 and cas latency of 2 figure 9. read with burst length of 2 and cas latency of 2 bclk ba btran bwait sdram cmd addr sdmc_data bd a0 a2 a3 a1 nseq seq seq seq nseq nop pre nop act nop read read read read nop nop no p bank row col0 col1 col2 col3 d0 d1 d2 d3 d0 d1 d2 d3 bclk ba btran bwait sdram cmd addr sdmc_data bd a0 a2 a3 a1 nseq seq seq seq nop pre nop act nop read read read read nop nop pre bank row col0 col1 col2 col3 d0 d1 d2 d3 d0 d1 x x bank
AT75C220 26 figure 10. read showing a single access for a non-sequential read to a new row writes can burst continuously until any of the following con- ditions are achieved: 1. the following access is a read. 2. the following access is to a new row. 3. the following access is non-sequential. when any of these conditions occur, the write burst is bro- ken and sdmc goes inactive. sdram refresh table 11 shows the counter values needed for a refresh rate of 15.625 s in the sdmc. as can be seen, at clock speeds of 1 mhz and below it is unfeasible to maintain data integrity in the sdram. note that in low power modes it is not a requirement to maintain data in the sdram. bclk ba btran bwait sdram cmd addr sdmc_data bd a0 a1 nseq nseq nop pre nop act nop read nop nop bank row col0 col1 d0 d0 incr incr hburst_h nop table 11. sdram refresh rates clock speed (mhz) tick (us) counter needed 40 0.25 62.5 81.2512.5 1 10 1.5625 0.025 400 0.0390625 0.0032 3125 0.005
AT75C220 27 sdmc register map base address: 0xff008000 sdram_mode register register name: sdram_mode access type: read/write reset value: 0x0  mode table 12. sdmc register map offset register name description access reset value 0x0000 sdram_mode mode register read/write 0x00000000 0x0004 sdram_timer timer register read/write 0x00000000 0x0008 sdram_cfg configuration register read/write 0x00000000 0x000c sdram_16bit selects 16-/32-bit modes read/write 0x00000001 0x0010 sdram_cs0_addr base address for cs0 read/write 0x00000040 0x0014 sdram_cs1_addr base address for cs1 read/write 0x00000050 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ??????? mode 76543210 mode ?????? mode description 000 normal mode. any access to the sdram will be decoded normally. 001 the nop command is issued to the sdram when the host accesses the sdram memory area, regardless of the cycle. 010 the all banks precharge command is issued to the sdram when the host accesses the sdram memory area, regardless of the cycle. 011 the load mode register command is issued to the sdram when the host accesses the sdram memory area, regardless of the cycle. the address offset with respect to the sdram memory base address is used to program the mode register. for example, when this mode is activated, an access to the ? sdram_base + offset ? generates a load mode register command with the value offset written to the mode register of the sdram. 100 a refresh command is issued to the sdram. an all banks precharge command must precede. others reserved
AT75C220 28 sdram_timer register register name: sdram_timer access type: read/write reset value: 0x0  cnt this 12-bit field is loaded into a timer which generates the refresh pulse. each time the refresh pulse is generated, a refresh burst is initiated. the length of this refresh burst (number of rows refreshed) can be adjusted at compile time by modifying the value rfsh_len. the refresh commands will begin when the timer is loaded for the first time. the value to be loaded depends on the clock frequency used in the sdmc configuration module, the refresh rate of the sdram and the refresh burst length where 15.6 microseconds is a typical value for a burst of length one. sdram_cfg register register name: sdram_cfg access type: read/write reset value: 0x0  nc sets the number of column bits. default is eight column bits. 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ???? cnt 76543210 cnt 31 30 29 28 27 26 25 24 ????? tras 23 22 21 20 19 18 17 16 trcd trp 15 14 13 12 11 10 9 8 trp trc twr 76543210 twr cas nb nr nc nc column bits 00 8 01 9 10 10 11 11
AT75C220 29  nr sets the number of row bits. default is 11 row bits.  nb sets the number of banks. default is two banks.  cas sets the cas latency. the sdmc has been modified so that it only supports a cas latency of two. writing to this reg- ister will have no effect.  twr sets the value of twr expressed in number of cycles. default is two cycles.  trc sets the value of trc expressed in number of cycles. default is eight cycles.  trp sets the value of trp expressed in number of cycles. default is three cycles.  trcd sets the value of trcd expressed in number of cycles. default is three cycles.  tras sets the value of tras expressed in number of cycles. default is five cycles. sdram_16bit register register name: sdram_16bit access type: read/write reset value: 0x1  16bit this bit is used to set the width of the external memory. if this field is set, the address is assumed to be 16 bits wide. if not set, the memory bus is assumed to be 32 bits wide. nr row bits 00 11 01 12 10 13 11 reserved nb number of banks 02 14 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ???????? 76543210 ??????? 16bit
AT75C220 30 sdram_cs0_addr register register name: sdram_cs0_addr access type: read/write reset value: 0x40  cs0_addr this bit is used to set the eight most significant bits of the address of cs0. sdram_cs1_addr register register name: sdram_cs1_addr access type: read/write reset value: 0x50  cs1_addr this bit is used to set the eight most significant bits of the address of cs1. 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ??????? cs0_addr 76543210 cs0_addr 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ??????? cs1_addr 76543210 cs1_addr
AT75C220 31 arbitration using multi-layer amba the AT75C220 has two separate asb (multi-layer amba) buses that can be decoupled during most normal opera- tions. the ability to couple the two asb buses is provided to allow the arm to receive and transmit ethernet frames via the two ethernet macs. the arm bus is the main processor bus to which most peripherals are connected. the mac bus is used exclusively for ethernet traffic. an asb-asb bridge that is transparent to the other devices on the bus connects the two asb buses. figure 11 shows the connection between the two buses. figure 11. asb - asb bridge the asb-asb bridge consists of two channels: the first is a master on the mac bus and a slave on the arm bus. the second channel is a master on the arm bus and a slave on the mac bus. the arm7tdmi is the default master and always requests the bus. it is always granted the bus in absence of a request from another master. the mac asb has two priority levels, the two macs share low priority access and the bridge has high priority. the macs do not burst more than four words per access and release the bus request between accesses so the macs can share a priority level with a simple round-robin arbitra- tion scheme. the arm is likely to be the only master accessing the mac bus via the bridge and should not perform more than a cou- ple of cycles before releasing the mac bus. care should be taken to prevent other masters on the arm bus holding the mac bus for more than a few cycles. otherwise, the macs drop frames due to fifo overflow or underflow. coupled bus operation when a master on one bus accesses a slave on the other bus, the following operations occur:  the master arbitrates for the local asb bus if it does not already have access to the bus.  when the local bus arbiter grants the master the local bus, the master initiates a cycle with an address corresponding to a slave on the remote bus.  the bridge is selected as the slave on the local bus and responds by inserting wait cycles. the bridge also requests the remote bus from the remote bus arbiter.  when the bridge is granted the remote bus, the two asb buses are coupled and the transfer completes. asb-asb bridge timing the amba asb performs pipelined arbitration. the bridge can only request the bus when the address of the slave is available. for this reason, the bridge must insert a wait cycle during the arbitration cycle on the remote bus because it cannot request the bus early. figure 12 shows a write cycle from a master on the arm bus to a slave on the mac bus. the slave does not add wait states. all cycles operate in the same way as the write cycle until the buses are coupled when the operation becomes slave- dependent. deadlock deadlock is avoided by forcing the arm processor to release the bus if both the arm and one of the macs request the bridge at the same time. the bridge responds to the arm with a signal to force the arm to retry the oper- ation later. the mac can complete its access and release the bus in the normal way. deadlock can still occur if a master that does not support retract attempts to access the mac bus at the same time as one of the macs is requesting the arm bus. this situa- tion is avoided if only the arm is used to access the mac bus. slave master slave master arm arbiter mac arbiter asb (arm) asb (mac) asb - asb bridge
AT75C220 32 figure 12. asb-to-asb bridge write timing bclk btran arm bus signals ba/bwrite dsel bwait bd mac bus signals breq bgnt ba/bwrite dsel bwait btran bd
AT75C220 33 ethernet mac the AT75C220 integrates two identical ethernet macs, known as mac a and mac b. the ethernet mac is described more fully in the ieee stan- dard 802.3. it is a programmable device on the apb bus by means of 56 configuration and status registers. the ether- net mac is an asb master. the main features of the ethernet mac are:  compatibility with ieee standard 802.3  10 and 100 mbit/s operation  full-and half-duplex operation  mii interface to the physical layer  register interface to address, status and control registers  dma interface  interrupt generation to signal receive and transmit completion  28-byte transmit and 28-byte receive fifos  automatic pad and crc generation on transmitted frames  address checking logic to recognize four 48-bit addresses  supports promiscuous mode where all valid frames are copied to memory  supports physical layer management through mdio interface dma operation frame data is transferred to and from the ethernet mac via the dma interface. all transfers are 32-bit words and may be single accesses or bursts of two, three or four words. burst accesses do not cross 16-byte boundaries. the dma controller performs four types of operations on the asb bus. in order of priority, they are receive buffer manager write, receive buffer manager read, transmit data dma read and receive data dma write. transmitter mode transmit frame data needs to be stored in contiguous memory locations and need not be word-aligned. the transmit address register is written with the address of the first byte to be transmitted. transmit is initiated by writ- ing the number of bytes to transfer (length) to the transmit control register. the transmit channel then reads data from memory 32 bits at a time and places them in the transmit fifo. the transmit block starts frame transmission once three words have been loaded into the fifo. the transmit address register must be written before the transmit control register. while a frame is being transmit- ted, it is possible to set up one other frame for transmission by writing new values to the transmit address and control registers. reading the transmit address register returns the address of the buffer currently being accessed by the trans- mit fifo. reading the transmit control register returns the total number of bytes to be transmitted. the buffer not queued bit in the transmit status register indicates whether table 13. external interface signal name description type col collision detect from the phy input crs carrier sense from the phy input txer transmit error signal to the phy. asserted if the dma block fails to fetch data from memory during frame transmission. output txd[3:0] transmit data to the phy output txen transmit enable to the phy output txclk transmit clock from the phy input rxd[3:0] receive data from the phy input rxer receive error signal from the phy input rxclk receive clock from the phy input rxdv receive data valid signal from the phy input mdc management data clock output mdio management data i/o input/output
AT75C220 34 another buffer can be safely queued. an interrupt is gener- ated whenever this bit is set. frame assembly starts by adding preamble and the start frame delimiter. data is taken from the transmit fifo word- by-word. if necessary, padding is added to make the frame length 60 bytes. the crc is calculated as a 32-bit polyno- mial. this is inverted and appended to the end of the frame, making the frame length a minimum of 64 bytes. the crc is not appended if the ncrc bit is set in the transmit con- trol register. in full duplex mode frames are transmitted immediately. back-to-back frames are transmitted at least 96 bit times apart to guarantee the interframe gap. in half-duplex mode the transmitter checks carrier sense. if asserted, it waits for it to de-assert and then starts trans- mission after the interframe gap of 96 bit times. if the collision signal is asserted during transmission, the transmitter will transmit a jam sequence of 32 bits taken from the data register and then retry transmission after the backoff time has elapsed. an error is indicated and any fur- ther attempts aborted if 16 attempts cause collisions. if transmit dma underruns, bad crc is automatically appended using the same mechanism as jam insertion. underrun also causes txer to be asserted. receiver mode when a packet is received, it is checked for valid preamble, crc, alignment, length and address. if all these criteria are met, the packet is stored successfully in a receive buffer. if at the end of reception the crc is bad, then the received buffer is recovered. each received frame including crc is written to a single receive buffer. receive buffers are word-aligned and are capable of con- taining 1518 bytes of data (the maximum length of an ethernet frame). the start location for each received frame is stored in memory in a list of receive buffer descriptors at a location pointed to by the receive buffer queue pointer register. each entry in the list consists of two words. the first word is the address of the received buffer; the second is the receive status. table 14 defines an entry in the received buffer descriptor list. to receive frames, the buffer queue must be initialized by writing an appropriate address to bits [31:2] in the first word of each list entry. bit zero must be written with zero. after a frame is received, bit zero becomes set and the second word indicates what caused the frame to be copied to memory. the start location of the received buffer descriptor list should be written to the received buffer queue pointer reg- ister before receive is enabled (by setting the receive enable bit in the network control register). as soon as the received block starts writing received frame data to the receive fifo, the received buffer manager reads the first receive buffer location pointed to by the received buffer queue pointer register. if the filter block is active, the frame should be copied to memory; the receive data dma opera- tion starts writing data into the receive buffer. if an error occurs, the buffer is recovered. if the frame is received without error, the queue entry is updated. the buffer pointer is rewritten to memory with its low-order bit set to indicate successful frame reception and a used buffer. the next word is written with the length of the frame and how the destination address was recognized. the next receive buffer location is then read from the fol- lowing word or, if the current buffer pointer had its wrap bit set, the beginning of the table. the maximum number of buffer pointers before a wrap bit is seen is 1024. if a wrap bit is not seen by then, a wrap bit is assumed in that entry. the received buffer queue pointer register must be written with zero in its lower-order bit positions to enable the wrap function to work correctly. if bit zero is set when the receive buffer manager reads the location of the receive buffer, then the buffer has already been used and cannot be used again until software has processed the frame and cleared bit zero. in this case, the dma block will set the buffer ? s unavailable bit in the received status register and trigger an interrupt. the frame will be discarded and the queue entry will be reread on reception of the next frame to see if the buffer is now avail- able. each discarded frame increments a statistics register that is cleared on being read. when there is network congestion, it is possible for the mac to be programmed to apply backpressure. this is when half-duplex mode collisions are forced on all received frames by transmitting 64 bits of data (a default pattern). reading the received buffer queue register returns the location of the queue entry currently being accessed. the queue wraps around to the start after either 1024 entries (i.e., 2048 words) or when the wrap bit is found to be set in bit 1 of the first word of an entry.
AT75C220 35 address checking whether or not a frame is stored depends on what is enabled in the network configuration register, the contents of the specific address and hash registers and the frame's destination address. in this implementation of the mac the frame ? s source address is not checked. a frame will not be copied to memory if the mac is trans- mitting in half-duplex mode at the time a destination address is received. the hash register is 64 bits long and takes up two locations in the memory map. there are four 48-bit specific address registers, each tak- ing up two memory locations. the first location contains the first four bytes of the address; the second location contains the last two bytes of the address stored in its least signifi- cant byte positions. the addresses stored can be specific, group, local or universal. ethernet frames are transmitted a byte at a time, lsb first. the first bit (i.e., the lsb of the first byte) of the destination address is the group/individual bit and is set one for multi- cast addresses and zero for unicast. this bit corresponds to bit 24 of the first word of the specific address register. the msb of the first byte of the destination address corre- sponds to bit 31 of the specific address register. the specific address registers are compared to the desti- nation address of received frames once they have been activated. addresses are deactivated at reset or when the first byte [47:40] is written and activated or when the last byte [7:0] is written. if a receive frame address matches an active address, the local match signal is set and the store frame pulse signal is sent to the dma block via the hclk synchronization block. a frame can also be copied if a unicast or multicast hash match occurs, it has the broadcast address of all ones, or the copy all frames bit in the network configuration register is set. the broadcast address of 0xffffffff is recognized if the no broadcast bit in the network configuration register is zero. this sets the broadcast match signal and triggers the store frame signal. the unicast hash enable and the multicast hash enable bits in the network configuration register enable the reception of table 14. received buffer descriptor list bit function word 0 31:2 address of beginning of buffer 1 wrap bit. if this bit is set, the counter that is ored with the received buffer queue pointer register to give the pointer to entries in this table will be cleared after the buffer is used. 0 ownership bit. 1 indicates software owns the pointer, 0 indicates that the dma owns the buffer. if this bit is not zero when the entry is read by the receiver, the buffer ? s unavailable bit is set in the received status register and the receiver goes inactive. word 1 31 global all ones broadcast address detected 30 multicast hash match 29 unicast hash match 28 external address (optional) 27 unknown source address (reserved for future use) 26 local address match (specific address 4 match) 25 local address match (specific address 3 match) 24 local address match (specific address 2 match) 23 local address match (specific address 1 match) 22:11 reserved written to 0. 10:0 length of frame including fcs
AT75C220 36 hash matched frames. so all multicast frames can be received by setting all bits in the hash register. the crc algorithm reduces the destination address to a 6- bit index into a 64-bit hash register. if the equivalent bit in the register is set, the frame will be matched depending on whether the frame is multicast or unicast and the appropri- ate match signals will be sent to the dma block if the copy all frames bit is set in the network configuration register, the store frame pulse will always be sent to the dma block as soon as any destination address is received. register map base address mac a: 0xff034000 base address mac b: 0xff038000 table 15. ethernet mac register map offset register name description access reset value 0x00 eth_ctl network control register read/write 0x0 0x04 eth_cfg network configuration register read/write 0x800 0x08 eth_sr network status register read-only 0x4 0x0c eth_tar transmit address register read/write 0x0 0x10 eth_tcr transmit control register read/write 0x0 0x14 eth_tsr transmit status register read/write 0x18 0x18 eth_rbqp receive buffer queue pointer read/write 0x0 0x1c ? reserved read-only 0x0 0x20 eth_rsr receive status register read/write 0x0 0x24 eth_isr interrupt status register read/write 0x0 0x28 eth_ier interrupt enable register write-only ? 0x2c eth_idr interrupt disable register write-only ? 0x30 eth_imr interrupt mask register read-only 0xffff 0x34 eth_man phy maintenance register read/write 0x0 statistics registers 0x40 eth_fra frames transmitted ok read/write 0x0 0x44 eth_scol single collision frames read/write 0x0 0x48 eth_mcol multiple collision frames read/write 0x0 0x4c eth_ok frames received ok read/write 0x0 0x50 eth_seqe frame check sequence errors read/write 0x0 0x54 eth_ale alignment errors read/write 0x0 0x58 eth_dte deferred transmission frames read/write 0x0 0x5c eth_lcol late collisions read/write 0x0 0x60 eth_ecol excessive collisions read/write 0x0 0x64 eth_cse carrier sense errors read/write 0x0 0x68 eth_tue transmit underrun errors read/write 0x0 0x6c eth_cde code errors read/write 0x0 0x70 eth_elr excessive length errors read/write 0x0
AT75C220 37 mac network control register register name: eth_ctl access type: read/write reset value: 0x0  lb loopback. optional.  lbl loopback local. connects txd to rxd, txen to rxdv, forces full duplex and drives rxclk and txclk with hclk divided by 4.  re receive enable. when set, enables the ethernet mac to receive data.  te transmit enable. when set, enables the ethernet transmitter to send data. 0x74 eth_rjb receive jabbers read/write 0x0 0x78 eth_usf undersize frames read/write 0x0 0x7c eth_sqee sqe test errors read/write 0x0 0x80 eth_drfc discarded rx frames read/write 0x0 address registers 0x90 eth_hsh hash register [63:32] read/write 0x0 0x94 eth_hsl hash register [31:0] read/write 0x0 0x98 eth_sa1l specific address 1, first 4 bytes read/write 0x0 0x9c eth_sa1h specific address 1, last 2 bytes read/write 0x0 0xa0 eth_sa2l specific address 2, first 4 bytes read/write 0x0 0xa4 eth_sa2h specific address 2, last 2 bytes read/write 0x0 0xa8 eth_sa3l specific address 3, first 4 bytes read/write 0x0 0xac eth_sa3h specific address 3, last 2 bytes read/write 0x0 0xb0 eth_sa4l specific address 4, first 4 bytes read/write 0x0 0xb4 eth_sa4h specific address 4, last 2 bytes read/write 0x0 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ??????? bp 76543210 wes isr csr mpe te re lbl lb table 15. ethernet mac register map (continued) offset register name description access reset value
AT75C220 38  mpe management port enable. set to one to enable the management port. when zero forces mdio to high impedance state.  csr clear statistics registers. this bit is write-only. writing a one clears the statistics registers.  isr increment statistics registers. this bit is write-only. writing a one increments all the statistics registers by one for test purposes.  wes write enable for statistics registers. setting this bit to one makes the statistics registers writable for functional test purposes.  bp back pressure. if this field is set, then in half-duplex mode collisions are forced on all received frames by transmitting 64 bits of data (default pattern). mac network configuration register register name: eth_cfg access type: read/write reset value: 0x8  spd speed. set to 1 to indicate 100mbit/sec. operation, 0 for 10mbit/sec. has no other functional effect.  fd full duplex. if set to 1, the transmit block ignores the state of collision and carrier sense and allows receive while transmitting.  br bit rate. optional.  caf copy all frames. when set to 1, all valid frames will be received.  nbc no broadcast. when set to 1, frames addressed to the broadcast address of all ones will not be received.  mti multicast hash enable, when set multicast frames will be received when six bits of the crc of the destination address point to a bit that is set in the hash register.  uni unicast hash enable. when set, unicast frames will be received when six bits of the crc of the destination address point to a bit that is set in the hash register. 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ??? rty clk eae big 76543210 uni mti nbc caf ? br fd spd
AT75C220 39  big receive 1522 bytes. when set, the mac will receive up to 1522 bytes. normally the mac will receive frames up to 1518 bytes in length.  eae external address match enable. optional.  clk the system clock (hclk) is divided down to generate mdc (the clock for the mdio). for conformance with ieee 802.3 mdc must not exceed 2.5 mhz. at reset this field is set to 10 so that hclk is divided by 32.  rty retry test. when set, the time between frames will always be one time slot. for test purposes only. must be cleared for normal operation. mac network status register register name: eth_sr access type: read-only reset value: 0x4  link the status of the link pin. optional.  mdio returns status of the mdio pin.  idle the phy management logic is idle (i.e., has completed). clk mdc 00 hclk divided by 8 01 hclk divided by 16 10 hclk divided by 32 11 hclk divided by 64 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ???????? 76543210 ????? idle mdio link
AT75C220 40 mac transmit address register register name: eth_tar access type: read/write reset value: 0x0  address transmit address register. written with the address of the frame to be transmitted, read as the base address of the buffer being accessed by the transmit fifo. note if the two least significant bits are not zero, transmit will start at the byte indicated. mac transmit control register register name: eth_tcr access type: read/write reset value: 0x0  len transmit frame length. this register is written to the number of bytes to be transmitted excluding the four crc bytes unless the no crc bit is asserted. writing these bits to any non-zero value will initiate transmit. if the value is greater than 1514 (1518 if no crc is being generated), an oversize frame will be transmitted. this field is buffered so that a new frame can be queued while the previous frame is still being transmitted. must always be written in address-then- length order. reads as the total number of bytes to be transmitted (i.e., this value does not change as the frame is transmitted.) frame transmission will not start until two 32-bit words have been loaded into the transmit fifo. the length must be great enough to ensure two words are loaded.  ncrc no crc. if this bit is set, it is assumed that the crc is included in the length being written in the low-order bits and the mac will not append crc to the transmitted frame. if the buffer is not at least 64 bytes long, a short frame will be sent. this field is buffered so that a new frame can be queued while the previous frame is still being transmitted. reads as the value of the frame currently being transmitted. 31 30 29 28 27 26 25 24 address 23 22 21 20 19 18 17 16 address 15 14 13 12 11 10 9 8 address 76543210 address 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ncrc ???? len 76543210 len
AT75C220 41 mac transmit status register register name: eth_tsr access type: read/write reset value: 0x18  ovr ethernet transmit buffer overrun. software wrote to the address register or length register when bit 4 was not set. cleared by writing a one to this bit.  col collision occurred. set by the assertion of collision. cleared by writing a one to this bit.  rle retry limit exceeded. cleared by writing a one to this bit.  idle transmitter idle. asserted when the transmitter has no frame to transmit. will be cleared when a length is written to transmit frame length portion of the transmit control register. this bit is read-only.  bnq ethernet transmit buffer not queued. software may write a new buffer address and length to the transmit dma control- ler. cleared by having one frame ready to transmit and another in the process of being transmitted. this bit is read- only.  comp transmit complete. set when a frame has been transmitted. cleared by writing a one to this bit.  und transmit underrun. set when transmit dma was not able to read data from memory in time. if this happens, the trans- mitter will force bad crc. cleared by writing a one to this bit. 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ???????? 76543210 ? und comp bnq idle rle col ovr
AT75C220 42 mac receive buffer queue pointer register name: eth_rbqp access type: read/write reset value: 0x0  address receive buffer queue pointer. written with the address of the start of the receive queue, reads as a pointer to the cur- rent buffer being used. the receive buffer is forced to word alignment. mac receive status register register name: eth_rsr access type: read/write reset value: 0x0  bna buffer not available. an attempt was made to get a new buffer and the pointer indicated that it was owned by the pro- cessor. the dma will reread the pointer each time a new frame starts until a valid pointer is found. this bit will be set at each attempt that fails even if it has not had a successful pointer read since it has been cleared. cleared by writing a one to this bit.  rec frame received. one or more frames have been received and placed in memory. cleared by writing a one to this bit.  ovr rx overrun. the dma block was unable to store the receive frame to memory, either because the asb bus was not granted in time or because a not ok hresp was returned. the buffer will be recovered if this happens. cleared by writing a one to this bit. 31 30 29 28 27 26 25 24 address 23 22 21 20 19 18 17 16 address 15 14 13 12 11 10 9 8 address 76543210 address 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ???????? 76543210 ????? ovr rec bna
AT75C220 43 mac interrupt status register register name: eth_isr access type: read/write reset value: 0x0  done management done. the phy maintenance register has completed its operation. cleared on read.  rcom receive complete. a frame has been stored in memory. cleared on read.  rbna receive buffer not available. cleared on read.  tovr transmit buffer overrun. software wrote to the address register or length register when bit 4 of the transmit status reg- ister was not set. cleared on read.  tund transmit error. ethernet transmit buffer underrun. the transmit dma did not complete fetch frame data in time for it to be transmitted. cleared on read.  trle transmit error. retry limit exceeded. cleared on read.  tbre transmit buffer register empty. software may write a new buffer address and length to the transmit dma controller. cleared by having one frame ready to transmit and another in the process of being transmitted. cleared on read.  tcom transmit complete. set when a frame has been transmitted. cleared on read.  link set when link pin changes value. optional.  tidle transmit idle. set when all frames have been transmitted. cleared on read.  rovr rx overrun. set when the rx overrun status bit is set. cleared on read.  hresp hresp not ok. set when the dma block sees hresp not ok. cleared on read. 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ???? hresp rovr link tidle 76543210 tcom tbre rtry tund tovr rbna rcom done
AT75C220 44 mac interrupt enable register register name: eth_ier access type: write-only reset value: ?  done enable management done interrupt.  rcom enable receive complete interrupt.  rbna enable receive buffer not available interrupt.  tovr enable ethernet transmit buffer overrun interrupt  tund enable transmit buffer underrun interrupt  rtry enable retry limit exceeded interrupt.  tbre enable transmit buffer register empty interrupt.  tcom enable transmit complete interrupt.  link enable link interrupt. optional.  tidle enable transmit idle interrupt.  rovr enable rx overrun interrupt.  hresp enable hresp not ok interrupt. 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ???? hresp rovr link tidle 76543210 tcom tbre rtry tund tovr rbna rcom done
AT75C220 45 mac interrupt disable register register name: eth_idr access type: write-only reset value: ?  done disable management done interrupt.  rcom disable receive complete interrupt.  rbna disable receive buffer not available interrupt.  tovr disable ethernet transmit buffer overrun interrupt.  tund disable transmit buffer underrun interrupt.  rtry disable retry limit exceeded interrupt.  tbre disable transmit buffer register empty interrupt.  tcom disable transmit complete interrupt.  link disable link interrupt. optional.  tidle disable transmit idle interrupt.  rovr disable rx overrun interrupt.  hresp disable hresp not ok interrupt. 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ???? hresp rovr link tidle 76543210 tcom tbre rtry tund tovr rbna rcom done
AT75C220 46 mac interrupt mask register register name: eth_imr access type: read-only reset value: 0xffff  done management done interrupt masked.  rcom receive complete interrupt masked.  rbna receive buffer not available interrupt masked.  tovr ethernet transmit buffer overrun interrupt masked  tund transmit buffer underrun interrupt masked  rtry retry limit exceeded interrupt masked.  tbre transmit buffer register empty interrupt masked.  tcom transmit complete interrupt masked.  link link interrupt masked.  tidle transmit idle interrupt masked.  rovr receive overrun interrupt masked.  hresp hresp not ok interrupt masked. 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ???? hresp rovr link tidle 76543210 tcom tbre rtry tund tovr rbna rcom done
AT75C220 47 mac phy maintenance register register name: eth_man access type: read/write reset value: 0x0 writing to this register starts the shift register that controls the serial connection to the phy. on each shift cycle the mdio pin becomes equal to the msb of the shift register and lsb of the shift register becomes equal to the value of the mdio pin. when the shifting is complete an interrupt is generated and the idle field is set in the network status register. when read will give current shifted value.  data for a write operation this is written with the data to be written to the phy. after a read operation this contains the data read from the phy.  code must be written to 10. will read as written.  rega register address. specifies the register in the phy to access.  phya phy address. normally will be 0.  rw read/write operation. 10 is read. 01 is write. any other value is an invalid phy management frame.  high must be written with 1 to make a valid phy management frame.  low must be written with 0 to make a valid phy management frame. 31 30 29 28 27 26 25 24 low high rw phya 23 22 21 20 19 18 17 16 phya rega code 15 14 13 12 11 10 9 8 data 76543210 data
AT75C220 48 mac hash address high register name: eth_hsh access type: read/write reset value: 0x0  addr hash address bits 63 to 32. mac hash address low register name: eth_hsl access type: read/write reset value: 0x0  addr hash address bits 31 to 0. 31 30 29 28 27 26 25 24 addr 23 22 21 20 19 18 17 16 addr 15 14 13 12 11 10 9 8 addr 76543210 addr 31 30 29 28 27 26 25 24 addr 23 22 21 20 19 18 17 16 addr 15 14 13 12 11 10 9 8 addr 76543210 addr
AT75C220 49 mac specific address (1, 2, 3 and 4) high register name: eth_sa1h,...eth_sa4h access type: read/write reset value: 0x0  addr unicast addresses (1, 2, 3 and 4), bits 47:32. mac specific address (1, 2, 3 and 4) low register name: eth_sa1l,...eth_sa4l access type: read/write reset value: 0x0  addr unicast addresses (1, 2, 3 and 4), bits 31:0. 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 addr 76543210 addr 31 30 29 28 27 26 25 24 addr 23 22 21 20 19 18 17 16 addr 15 14 13 12 11 10 9 8 addr 76543210 addr
AT75C220 50 mac statistics register block these registers reset to zero on a read and stick at all ones when they count to their maximum value. they should be read frequently enough to prevent loss of data. the statistics register block contains the registers found in table 16. table 16. statistics register block register name description eth_fra frames transmitted ok. a 24-bit register counting the number of frames successfully transmitted. eth_scol single collision frames. a 16-bit register counting the number of frames experiencing a single collision before being transmitted and experiencing no carrier loss nor underrun. eth_mcol multiple collision frames. a 16-bit register counting the number of frames experiencing between two and fifteen collisions prior to being transmitted (62 - 1518 bytes, no carrier loss, no underrun). eth_ok frames received ok. a 24-bit register counting the number of good frames received, i.e. address recognized. a good frame is of length 64 to 1518 bytes and has no fcs, alignment or code errors. eth_seqe frame checks sequence errors. an 8-bit register counting address-recognized frames with an integral number of bytes long and that have bad crc and 64 to 1518 bytes long. eth_ale alignment errors. an 8-bit register counting frames that are: - address recognized, - not an integral number of bytes long - have bad crc when their length is truncated to an integral number of bytes - between 64 and 1518 bytes in length. eth_dte deferred transmission frames. a 16-bit register counting the number of frames experiencing deferral due to carrier sense active on their first attempt at transmission (no underrun or collision). eth_lcol late collisions. an 8-bit register counting the number of frames that experience a collision after the slot time (512 bits) has expired. no carrier loss or underrun. a late collision is counted twice, i.e., both as a collision and a late collision. eth_ecol excessive collisions. an 8-bit register counting the number of frames that failed to be transmitted because they experienced 16 collisions. (64 - 1518 bytes, no carrier loss or underrun) eth_cse carrier sense errors. an 8-bit register counting the number of frames for which carrier sense was not detected and maintained in half-duplex mode a slot time (512 bits) after the start of transmission (no excessive collision). eth_tue transmit errors. an 8-bit register counting the number of frames not transmitted due to a transmit dma underrun. if this register is incremented, then no other register is incremented. eth_cde code errors. an 8-bit register counting the number of frames that are address recognized, had rxer asserted during reception. if this counter is incremented, then no other counters are incremented. eth_elr excessive length frames. an 8-bit register counting the number of frames received exceeding 1518 bytes in length but that do not have either a crc error, an alignment error or a code error. eth_rjb receive jabbers. an 8-bit register counting the number of frames received exceeding 1518 bytes in length and having either a crc error, an alignment error or a code error. eth_usf undersize frames. an 8-bit register counting the number of frames received less than 64 bytes in length but that do not have either a crc error, an alignment error or a code error. eth_sqee sqee test errors. an 8-bit register counting the number of frames where col was not asserted within a slot time of txen being deasserted. eth_drfc discarded receive frames count. this 16-bit counter is incremented every time an address-recognized frame is received but cannot be copied to memory because the receive buffer is available.
AT75C220 51 aic: advanced interrupt controller the AT75C220 integrates the atmel advanced interrupt controller (aic). for details on this peripheral, refer to the datasheet, literature number 1246. the interrupt controller is connected to the fast interrupt request (nfiq) and the standard interrupt request (nirq) inputs of the arm7tdmi processor. the processor ? s nfiq line can only be asserted by the external fast interrupt request input (fiq). the nirq line can be asserted by the interrupts generated by the on-chip peripherals and the two external interrupt request lines, irq0 to irq1. an 8-level priority encoder allows the user to define the pri- ority between the different interrupt sources. internal sources are programmed to be level-sensitive or edge-trig- gered. external sources can be programmed to be positive- or negative-edge triggered or high- or low-level sensitive. figure 13. advanced interrupt controller block diagram table 17. interrupt sources interrupt source interrupt name interrupt description 0 fiq fast interrupt (lowp) 1 wdt watchdog interrupt 2 swi software interrupt 3 uarta usart a interrupt 4 tc0 timer channel 0 interrupt 5 tc1 timer channel 1 interrupt 6 tc2 timer channel 2 interrupt 7 pioa pio a interrupt 8 maca mac a interrupt 9 spi serial peripheral interface 10 irq0 external interrupt 11 irq1 external interrupt 12 oaka oak semaphore interrupt 13 macb mac b interrupt control logic memorization memorization prioritization controller nirq manager nfiq manager fiq source advanced peripheral bus (apb) internal interrupt sources external interrupt sources arm7tdmi core nfiq nirq
AT75C220 52 priority controller the nirq line is controlled by an 8-level priority encoder. each source has a programmable priority level of 7 to 0. level 7 is the highest priority and level 0 the lowest. when the aic receives more than one unmasked interrupt at a time, the interrupt with the highest priority is serviced first. if both interrupts have equal priority, the interrupt with the lowest interrupt source number is serviced first. the current priority level is defined as the priority level of the current interrupt at the time the register aic_ivr is read (the interrupt which will be serviced). in the case when a higher priority unmasked interrupt occurs while an inter- rupt already exists, there are two possible outcomes depending on whether the aic_ivr has been read. 1. if the nirq line has been asserted but the aic_ivr has not been read, then the processor will read the new higher priority interrupt handler number in the aic_ivr register and the current interrupt level is updated. 2. if the processor has already read the aic_ivr, then the nirq line is reasserted. when the processor has authorized nested interrupts to occur and reads the aic_ivr again, it reads the new, higher priority interrupt handler address. at the same time the cur- rent priority value is pushed onto a first-in last-out stack and the current priority is updated to the higher priority. when the end of interrupt command register (aic_eoicr) is written, the current interrupt level is updated with the current interrupt level from the stack (if any). hence, at the end of a higher priority interrupt, the aic returns to the previous state corresponding to the pre- ceding lower priority interrupt which had been interrupted. interrupt handling the interrupt handler must read the aic_ivr as soon as possible. this deasserts the nirq request to the processor and clears the interrupt in case it is programmed to be edge-triggered. this permits the aic to assert the nirq line again when a higher priority unmasked interrupt occurs. at the end of the interrupt service routine, the end of inter- rupt command register (aic_eoicr) must be written. this allows pending interrupts to be serviced. interrupt masking each interrupt source, including fiq, can be enabled or disabled using the command registers aic_iecr and aic_idcr. the interrupt mask can be read in the read only register aic_imr. a disabled interrupt does not affect the servicing of other interrupts. interrupt clearing and setting all interrupt sources which are programmed to be edge- triggered (including fiq) can be individually set or cleared by respectively writing to the registers aic_iscr and aic_iccr. this function of the interrupt controller is avail- able for auto-test or software debug purposes. standard interrupt sequence it is assumed that:  the advanced interrupt controller has been programmed, aic_svr registers are loaded with corresponding interrupt service routine addresses and interrupts are enabled. when nirq is asserted and if the bit i of cpsr is 0, the sequence is as follows: 1. the cpsr is stored in spsr_irq, the current value of the program counter is loaded in the irq link register (r14_irq) and the program counter (r15) is loaded with 0x18. in the following cycle during fetch at address 0x1c, the arm core adjusts r14_irq, decrementing it by 4. 2. the arm core enters irq mode if it is not already. 3. when the instruction at 0x18 is executed, the pro- gram counter is loaded with the value read in the aic_ivr. reading the aic_ivr has the following effects: sets the current interrupt to be the pending one with the highest priority. the current level is the priority level of the current interrupt. de-assserts the nirq line on the processor (even if vectoring is not used, aic_ivr must be read in order to de-assert nirq). automatically clears the interrupt if it has been pro- grammed to be edge-triggered. pushes the current level on to the stack. returns the aic_svr corresponding to the current interrupt. 14 uartb usart b interrupt 15 piob pio b interrupt 16 - 31 reserved table 17. interrupt sources (continued) interrupt source interrupt name interrupt description
AT75C220 53 4. the previous step establishes a connection to the corresponding isr. this begins by saving the link register (r14_irq) and the spsr (spsr_irq). note that the link register must be decrermented by 4 when it is saved if it is to be restored directly into the program counter at the end of the interrupt. 5. further interrupts can then be unmasked by clear- ing the i bit in the cpsr, allowing re-assertion of the nirq to be taken into account by the core. this can occur if an interrupt with a higher priority than the current one occurs. 6. the interrupt handler then proceeds as required, saving the registers which are used and restoring them at the end. during this phase, an interrupt of priority higher than the current level will restart the sequence from step 1. note that if the interrupt is programmed to be level-sensitive, the source of the interrupt must be cleared during this phase. 7. the i bit in the cpsr must be set in order to mask interrupts before exiting to ensure that the interrupt is completed in an orderly manner. 8. the service routine should then connect to the com- mon exit routine. 9. the end of interrupt command register (aic_eoicr) must be written in order to indicate to the aic that the current interrupt is finished. this causes the current level to be popped from the stack, restoring the previous current level if one exists. if another interrupt with lower or equal prior- ity than the old current level is pending, the nirq line is re-asserted but the interrupt sequence does not immediately start because the i bit is set in the core. 10. the spsr (spsr_irq) is restored. finally, the saved value of the link register is restored directly into the pc. this has the effect of returning from the interrupt to the step previously executed, of loading the cpsr with the stored spsr and of masking or unmasking the interrupts depending on the state saved in the spsr (the previous state of the arm core). note: the i bit in the spsr is significant. if it is set, it indicates that the arm core was just about to mask irq interrupts when the mask instruction was interrupted. hence, when the spsr is restored, the mask instruction is completed (irq is masked). fast interrupt the external fiq line is the only source which can raise a fast interrupt request to the processor. therefore it has no priority controller. it can be programmed to be positive- or negative-edge triggered or high- or low-level sensitive in the aic_smr0 register. the fast interrupt handler address can be stored in the aic_svr0 register. the value written into this register is available by reading the aic_fvr register when an fiq interrupt is raised. by storing the following instruction at address 0x0000001c, the processor will load the program counter with the interrupt handler address stored in the aic_fvr register. ldr pc, [pc, #-&f20] alternatively, the interrupt handler can be stored starting from address 0x0000001c as described in the arm7tdmi datasheet. fast interrupt sequence it is assumed that:  the advanced interrupt controller has been programmed, aic_svr[0] is loaded with the fast interrupt service routine address and the fast interrupt is enabled.  nested fast interrupts are not needed by the user. when nfiq is asserted, if the bit f of cpsr is 0, the sequence is: 1. the cpsr is stored in spsr_fiq, the current value of the program counter is loaded in the fiq link register (r14_fiq) and the program counter (r15) is loaded with 0x1c. in the following cycle, during fetch at address 0x20, the arm core adjusts r14_fiq, decrementing it by 4. 2. the arm core enters fiq mode. 3. when the instruction loaded at address 0x1c is executed, the program counter is loaded with the value read in aic_fvr. reading the aic_fvr has the effect of clearing the fast interrupt (source 0 connected to the fiq line) if it has been pro- grammed to be edge-triggered. in this case only, it de-asserts the nfiq line on the processor. 4. the previous step establishes a connection to the corresponding interrupt service routine. it is not necessary to save the link register (r14_fiq) and the spsr (spsr_fiq) if nested fast interrupts are not needed. 5. the interrupt handler can then proceed as required. it is not necessary to save registers r8 to r13 because fiq mode has its own dedicated registers and the user r8 to r13 are banked. the other reg- isters, r0 to r7, must be saved before being used and restored at the end (before the next step). note that if the fast interrupt is programmed to be level- sensitive, the source of the interrupt must be
AT75C220 54 cleared during this phase in order to de-assert the nfiq line. 6. finally, the link register (r14_fiq) is restored into the pc after decrementing it by 4 (e.g., with instruc- tion sub pc, lr, #4). this has the effect of returning from the interrupt to the step previously executed, of loading the cpsr with the spsr and of masking or unmasking the fast interrupt depend- ing on the state saved in the spsr. note: the f bit in the spsr is significant. if it is set, it indicates that the arm core was just about to mask fiq interrupts when the mask instruction was interrupted. hence, when the spsr is restored, the interrupted instruction is com- pleted (fiq is masked). software interrupt any interrupt source of the aic can be a software interrupt. it must be programmed to be edge-triggered in order to set or clear it by writing to the aic_iscr and aic_iccr. this is totally independent of the swi instruction of the arm7tdmi processor. spurious interrupt a spurious interrupt is a signal of very short duration on one of the interrupt input lines. a spurious interrupt also arises when an interrupt is triggered and masked in the same cycle. spurious interrupt sequence a spurious interrupt is handled by the following sequence of actions. 1. when an interrupt is active, the aic asserts the nirq (or nfiq) line and the arm7tdmi enters irq (or fiq) mode. at this moment, if the interrupt source disappears, the nirq (or nfiq) line is de- asserted but the arm7tdmi continues with the interrupt handler. 2. if the irq vector register (aic_ivr) is read when the nirq is not asserted, the aic_ivr is read with the contents of the spurious interrupt vector register. 3. if the fiq vector register (aic_fvr) is read when the nfiq is not asserted, the aic_fvr is read with the contents of the spurious interrupt vector register. 4. the spurious isr must write an end of interrupt command as a minimum, however, it is sufficient to write to the end of interrupt command register (aic_eoicr). until the aic_eoicr write is received by the interrupt controller, the nirq (or nfiq) line is not re-asserted. 5. this causes the arm7tdmi to jump into the spuri- ous interrupt routine. 6. during a spurious isr, the aic_isr reads 0.
AT75C220 55 aic user interface base address: 0xff030000 note: 1. the reset value of this register depends on the level of the external irq lines. all other sources are cleared at reset. aic source mode register register name: aic_smr0...aic_smr31 access type: read/write reset value: 0  prior: priority level programs the priority level for all sources except source 0 (fiq). the priority level can be between 0 (lowest) and 7 (highest). the priority level is not used for the fiq in the smr0. table 18. aic memory map offset register name register access reset state 0x000 0x004 ? 0x07c aic_smr0 aic_smr1 ? aic_smr31 source mode register 0 source mode register 1 ? source mode register 31 read/write read/write ? read/write 0 0 ? 0 0x080 0x084 ? 0xfc0 aic_svr0 aic_svr1 ? aic_svr31 source vector register 0 source vector register 1 ? source vector register 31 read/write read/write ? read/write 0 0 ? 0 0x100 0x104 0x108 0x10c aic_ivr aic_fvr aic_isr aic_ipr irq vector register fiq vector register interrupt status register interrupt pending register read-only read-only read-only read-only 0 0 0 see note 1 0x110 0x114 0x118 0x11c aic_imr aic_cisr ? ? interrupt mask register core interrupt status register reserved reserved read-only read-only ? ? 0 0 ? ? 0x120 0x124 0x128 0x12c aic_iecr aic_idcr aic_iccr aic_iscr interrupt enable command register interrupt disable command register interrupt clear command register interrupt set command register write-only write-only write-only write-only ? ? ? ? 0x130 aic_eoicr end-of-interrupt command register write-only ? 0x134 aic_spu spurious interrupt vector register read/write 0 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ???????? 76543210 ? srctype ?? prior
AT75C220 56  srctype: interrupt source type programs the input to be positive- or negative-edge triggered or positive- or negative-level sensitive. the active level or edge is not programmable for the internal sources. aic source vector registers register name: aic_svr0...aic_svr31 access type: read/write reset value: 0  vector in these registers, the user may store the addresses of the corresponding handler for each interrupt source. aic interrupt vector registers register name: aic_ivr access type: read-only reset value: 0  irqv the irq vector register contains the vector programmed by the user in the source vector register corresponding to the current interrupt. the svr register (1 to 31) is indexed by the current interrupt number when the ivr register is read. when there is no interrupt, the irq register reads 0. srctype internal sources external sources 00 level-sensitive low-level sensitive 01 edge-triggered negative-edge triggered 10 level-sensitive high-level sensitive 11 edge-triggered positive-edge triggered 31 30 29 28 27 26 25 24 vector 23 22 21 20 19 18 17 16 vector 15 14 13 12 11 10 9 8 vector 76543210 vector 31 30 29 28 27 26 25 24 irqv 23 22 21 20 19 18 17 16 irqv 15 14 13 12 11 10 9 8 irqv 76543210 irqv
AT75C220 57 aic fiq vector register register name: aic_fvr access type: read-only reset value: 0  fiq the vector register contains the vector programmed by the user in svr register 0 which corresponds to fiq. aic interrupt status register register name: aic_isr access type: read-only reset value: 0  irqid the interrupt status register returns the current interrupt source register. 31 30 29 28 27 26 25 24 fiqv 23 22 21 20 19 18 17 16 fiqv 15 14 13 12 11 10 9 8 fiqv 76543210 fiqv 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ???????? 76543210 ??? irqid
AT75C220 58 aic interrupt pending register register name: aic_ipr access type: read-only reset value: undefined note: 1. irq1 is available only in 256-lead pqfp package.  interrupt pending 0 = corresponding interrupt is inactive 1 = corresponding interrupt is pending aic interrupt mask register register name: aic_imr access type: read-only reset value: 0 note: 1. irq1 is available only in 256-lead pqfp package.  interrupt pending 0 = corresponding interrupt is inactive 1 = corresponding interrupt is pending 31 30 29 28 27 26 25 24 00000000 23 22 21 20 19 18 17 16 00000000 15 14 13 12 11 10 9 8 piob usartb macb oaka irq1 (1) int0 spi maca 76543210 pioa tc2 tc1 tc0 usarta swi wdt fiq 31 30 29 28 27 26 25 24 00000000 23 22 21 20 19 18 17 16 00000000 15 14 13 12 11 10 9 8 piob usartb macb oaka irq1 (1) int0 spi maca 76543210 pioa tc2 tc1 tc0 usarta swi wdt fiq
AT75C220 59 aic core interrupt status register register name: aic_cisr access type: read-only reset value: 0  nfiq: nfiq status 0 = nfiq line inactive. 1 = nfiq line active.  nirq: nirq status 0 = nirq line inactive. 1 = nirq line active. aic interrupt enable command register register name: aic_iecr access type: write-only reset value: undefined  nfiq: nfiq status 0 = nfiq line inactive. 1 = nfiq line active.  nirq: nirq status 0 = nirq line inactive. 1 = nirq line active. 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ???????? 76543210 ?????? nirq nfiq 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ???????? 76543210 ?????? nirq nfiq
AT75C220 60 aic interrupt disable command register register name: aic_idcr access type: write-only reset value: undefined  nfiq: nfiq status 0 = nfiq line inactive. 1 = nfiq line active.  nirq: nirq status 0 = nirq line inactive. 1 = nirq line active. aic interrupt clear command register register name: aic_iccr access type: write-only reset value: undefined  nfiq: nfiq status 0 = nfiq line inactive. 1 = nfiq line active.  nirq: nirq status 0 = nirq line inactive. 1 = nirq line active. 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ???????? 76543210 ?????? nirq nfiq 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ???????? 76543210 ?????? nirq nfiq
AT75C220 61 aic interrupt set command register register name: aic_iscr access type: write only reset value: undefined  nfiq: nfiq status 0 = nfiq line inactive. 1 = nfiq line active.  nirq: nirq status 0 = nirq line inactive. 1 = nirq line active. aic end of interrupt command register register name: aic_eoicr access type: write-only the end of interrupt command register is used by the interrupt routine to indicate that the interrupt treatment is complete. any value can be written because it is only necessary to make a write to this register location to signal the end of interrupt treatment. 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ???????? 76543210 ?????? nirq nfiq 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ???????? 76543210 ????????
AT75C220 62 aic spurious interrupt vector register register name: aic_spu access type: read/write reset value: 0  siqv this register contains the 32-bit address of an interrupt routine which is used to treat cases of spurious interrupts. the programmed address is read in the aic_ivr if it is read when the nirq line is not asserted. the programmed address is read in the aic_fvr if it read when the nfiq line is not asserted. 31 30 29 28 27 26 25 24 siqv 23 22 21 20 19 18 17 16 siqv 15 14 13 12 11 10 9 8 siqv 76543210 siqv
AT75C220 63 pio: programmable i/o controller the AT75C220 integrates 24 programmable i/o pins (pio). each pin can be programmed as an input or an output. each pin can also generate an interrupt. the programma- ble i/o is implemented as two blocks, called pio a and pio b, 14 and 10 pins each, respectively. these pins are used for several functions:  external i/o for internal peripherals  keypad controller function  general-purpose i/o  visibility in test/debug mode, e.g., multiplex cbus for the oak the keypad controller is implemented by using up to ten pio b pins as row drivers and column sensors for an off- chip switch matrix. this block is identical to the pioa except that only 14 pins are controlled. the pio b register map defines an set of registers identical to the pio a register map. every pio b register allocates the same bit position to the corresponding pio b pin. these registers are otherwise identical to the pio a registers. multiplexed i/o lines output selection the user can enable each individual i/o signal as an output with the registers pio_oer and pio_odr. the output sta- tus of the i/o signals can be read in the register pio_osr. the direction defined has an effect only if the pin is config- ured to be controlled by the pio controller. i/o levels each pin can be configured to be driven high or low. the level is defined in four different ways, according to the fol- lowing conditions: if a pin is controlled by the pio controller and is defined as an output (see ? output selection ? ), the level is programmed using the registers pio_sodr and pio_codr. in this case, the programmed value can be read in the register pio_odsr. if a pin is controlled by the pio controller and is not defined as an output, the level is determined by the external circuit. if a pin is not controlled by the pio controller, the state of the pin is defined by the peripheral (see peripheral datasheets). in all cases, the level on the pin can be read in the register pio_pdsr. interrupts each parallel i/o can be programmed to generate an inter- rupt when a level change occurs. this is controlled by the pio_ier and pio_idr registers which enable/disable the i/o interrupt by setting/clearing the corresponding bit in the pio_imr. when a change in level occurs, the correspond- ing bit in the pio_isr is set depending on whether the pin is used as a pio or a peripheral, and whether it is defined as input or output. if the corresponding interrupt in pio_imr is enabled, the pio interrupt is asserted. when pio_isr is read, the register is automatically cleared. user interface each individual i/o is associated with a bit position in the parallel i/o user interface registers. each of these registers is 32 bits wide. if a parallel i/o line is not defined, writing to the corresponding bits has no effect. undefined bits read as zero.
AT75C220 64 figure 14. parallel i/o multiplexed with a bid-directional signal pad pio_osr 1 0 1 0 pio_psr pio_odsr 0 1 pio_psr event detection pio_pdsr pio_isr pio_imr peripheral output enable peripheral output peripheral input pioirq pad output enable pad output pad input
AT75C220 65 . note: 1. used if tst pin is active. table 19. pio controller a connection table pin name signal name signal description type pin number pa0 oakain0 oakdspcore user input 0 input 182 pa1 oakain1 oakdspcore user input 1 input 181 pa2 oakaout0 oakdspcore user output 0 output 180 pa3 oakaout1 oakdspcore user output 1 output 179 pa 4 178 pa 5 177 pa 6 174 pa 7 173 pa8 tclk0 timer 0 clock signal input 172 pa9 tioa0 timer 0 signal a i/o 171 pa10 tiob0 timer 0 signal b i/o 170 pa11 scka usart a serial clock i/o 169 pa12 npcs1 optional spi chip select 1 output 166 pa19 aclk arm system clock i/o 163 table 20. pio controller b connection table pin name signal name signal description type pin number pb0 tclk1 timer 1 clock signal input 194 pb1 tioa1 timer 1 signal a i/o 195 pb2 tiob1 timer 1 signal b i/o 196 pb3 nctsa usart a modem control (1) input 197 pb4 no attached peripheral 198 pb5 nria usart a ring indicator input 199 pb6 nwdovf wdt overflow output 200 pb7 nce1 chip select 1 output 201 pb8 nce2 chip select 2 output 202 pb9 no peripheral connected 203
AT75C220 66 pio user interface pio controller a base address: 0xff00c000 pio controller b base address: 0xff010000 notes: 1. the reset value of this register depends on the level of the external pins at reset. 2. this register is cleared at reset. however, the first read of the register can give a value not equal to zero if any changes have occurred on any pins between the reset and the read. table 21. pio controller memory map offset register name description access reset value 0x00 pio_per pio enable register write-only ? 0x04 pio_pdr pio disable register write-only ? 0x08 pio_psr pio status register read-only ? 0x0c ? reserved ?? 0x10 pio_oer output enable register write-only ? 0x14 pio_odr output disable register write-only ? 0x18 pio_osr output status register read-only 0x0 0x1c ? reserved ?? 0x20 ? reserved ?? 0x24 ? reserved ?? 0x28 ? reserved ? 0x0 0x2c ? reserved ?? 0x30 pio_sodr set output data register write-only ? 0x34 pio_codr clear output data register write-only ? 0x38 pio_odsr output data status register read-only 0x0 0x3c pio_pdsr pin data status register read-only see note 1 0x40 pio_ier interrupt enable register write-only ? 0x44 pio_idr interrupt disable register write-only ? 0x48 pio_imr interrupt mask register read-only ? 0x4c pio_isr interrupt status register read-only see note 2
AT75C220 67 pio enable register register name: pio_per access type: write-only this register is used to enable individual pins to be controlled by the pio controller instead of the associated peripheral. when the pio is enabled, the associated peripheral (if any) is held at logic zero. 1 = enables the pio to control the corresponding pin (disables peripheral control of the pin). 0 = no effect. pio disable register register name: pio_pdr access type: write-only this register is used to disable pio control of individual pins. when the pio control is disabled, the normal peripheral func- tion is enabled on the corresponding pin. 1 = disables pio control (enables peripheral control) on the corresponding pin. 0 = no effect. 31 30 29 28 27 26 25 24 p31 p30 p29 p28 p27 p26 p25 p24 23 22 21 20 19 18 17 16 p23 p22 p21 p20 p19 p18 p17 p16 15 14 13 12 11 10 9 8 p15 p14 p13 p12 p11 p10 p9 p8 76543210 p7 p6 p5 p4 p3 p2 p1 p0 31 30 29 28 27 26 25 24 p31 p30 p29 p28 p27 p26 p25 p24 23 22 21 20 19 18 17 16 p23 p22 p21 p20 p19 p18 p17 p16 15 14 13 12 11 10 9 8 p15 p14 p13 p12 p11 p10 p9 p8 76543210 p7 p6 p5 p4 p3 p2 p1 p0
AT75C220 68 pio status register register name: pio_psr access type: read-only this register indicates which pins are enabled for pio control. this register is updated when pio lines are enabled or dis- abled. 1 = pio is active on the corresponding line (peripheral is inactive). 0 = pio is inactive on the corresponding line (peripheral is active). pio output enable register register name: pio_oer access type: write-only this register is used to enable pio output drivers. if the pin is driven by a peripheral, there is no effect on the pin but the information is stored. the register is programmed as follows: 1 = enables the pio output on the corresponding pin. 0 = no effect. 31 30 29 28 27 26 25 24 p31 p30 p29 p28 p27 p26 p25 p24 23 22 21 20 19 18 17 16 p23 p22 p21 p20 p19 p18 p17 p16 15 14 13 12 11 10 9 8 p15 p14 p13 p12 p11 p10 p9 p8 76543210 p7 p6 p5 p4 p3 p2 p1 p0 31 30 29 28 27 26 25 24 p31 p30 p29 p28 p27 p26 p25 p24 23 22 21 20 19 18 17 16 p23 p22 p21 p20 p19 p18 p17 p16 15 14 13 12 11 10 9 8 p15 p14 p13 p12 p11 p10 p9 p8 76543210 p7 p6 p5 p4 p3 p2 p1 p0
AT75C220 69 pio output disable register register name: pio_odr access type: write-only this register is used to disable pio output drivers. if the pin is driven by the peripheral, there is no effect on the pin, but the information is stored. the register is programmed as follows: 1 = disables the pio output on the corresponding pin. 0 = no effect. pio output status register register name: pio_osr access type: read-only reset value: 0 this register shows the pio pin control (output enable) status which is programmed in pio_oer and pio odr. the defined value is effective only if the pin is controlled by the pio. the register reads as follows: 1 = the corresponding pio is output on this line. 0 = the corresponding pio is input on this line. 31 30 29 28 27 26 25 24 p31 p30 p29 p28 p27 p26 p25 p24 23 22 21 20 19 18 17 16 p23 p22 p21 p20 p19 p18 p17 p16 15 14 13 12 11 10 9 8 p15 p14 p13 p12 p11 p10 p9 p8 76543210 p7 p6 p5 p4 p3 p2 p1 p0 31 30 29 28 27 26 25 24 p31 p30 p29 p28 p27 p26 p25 p24 23 22 21 20 19 18 17 16 p23 p22 p21 p20 p19 p18 p17 p16 15 14 13 12 11 10 9 8 p15 p14 p13 p12 p11 p10 p9 p8 76543210 p7 p6 p5 p4 p3 p2 p1 p0
AT75C220 70 pio set output data register register name: pio_sodr access type: write-only this register is used to set pio output data. it affects the pin only if the corresponding pio output line is enabled and if th e pin is controlled by the pio. otherwise, the information is stored. 1 = pio output data on the corresponding pin is set. 0 = no effect. pio clear output data register register name: pio_codr access type: write-only this register is used to clear pio output data. it affects the pin only if the corresponding pio output line is enabled and if the pin is controlled by the pio. otherwise, the information is stored. 1 = pio output data on the corresponding pin is cleared. 0 = no effect. 31 30 29 28 27 26 25 24 p31 p30 p29 p28 p27 p26 p25 p24 23 22 21 20 19 18 17 16 p23 p22 p21 p20 p19 p18 p17 p16 15 14 13 12 11 10 9 8 p15 p14 p13 p12 p11 p10 p9 p8 76543210 p7 p6 p5 p4 p3 p2 p1 p0 31 30 29 28 27 26 25 24 p31 p30 p29 p28 p27 p26 p25 p24 23 22 21 20 19 18 17 16 p23 p22 p21 p20 p19 p18 p17 p16 15 14 13 12 11 10 9 8 p15 p14 p13 p12 p11 p10 p9 p8 76543210 p7 p6 p5 p4 p3 p2 p1 p0
AT75C220 71 pio output data status register register name: pio_odsr access type: read-only reset value: 0 this register shows the output data status which is programmed in pio_sodr or pio_codr. the defined value is effec- tive only if the pin is controlled by the pio controller and only if the pin is defined as an output. 1 = the output data for the corresponding line is programmed to 1. 0 = the output data for the corresponding line is programmed to 0. pio pin data status register register name: pio_pdsr access type: read-only reset value: undefined this register shows the state of the physical pin of the chip. the pin values are always valid, regardless of whether the pins are enabled as pio, peripheral, input or output. the register reads as follows: 1 = the corresponding pin is at logic 1. 0 = the corresponding pin is at logic 0. 31 30 29 28 27 26 25 24 p31 p30 p29 p28 p27 p26 p25 p24 23 22 21 20 19 18 17 16 p23 p22 p21 p20 p19 p18 p17 p16 15 14 13 12 11 10 9 8 p15 p14 p13 p12 p11 p10 p9 p8 76543210 p7 p6 p5 p4 p3 p2 p1 p0 31 30 29 28 27 26 25 24 p31 p30 p29 p28 p27 p26 p25 p24 23 22 21 20 19 18 17 16 p23 p22 p21 p20 p19 p18 p17 p16 15 14 13 12 11 10 9 8 p15 p14 p13 p12 p11 p10 p9 p8 76543210 p7 p6 p5 p4 p3 p2 p1 p0
AT75C220 72 pio interrupt enable register register name: pio_ier access type: write-only this register is used to enable pio interrupts on the corresponding pin. it has an effect whether pio is enabled or not. 1 = enables an interrupt when a change of logic level is detected on the corresponding pin. 0 = no effect. pio interrupt disable register register name: pio_idr access type: write-only this register is used to disable pio interrupts on the corresponding pin. it has an effect whether the pio is enabled or not. 1 = disables the interrupt on the corresponding pin. logic level changes are still detected. 0 = no effect. 31 30 29 28 27 26 25 24 p31 p30 p29 p28 p27 p26 p25 p24 23 22 21 20 19 18 17 16 p23 p22 p21 p20 p19 p18 p17 p16 15 14 13 12 11 10 9 8 p15 p14 p13 p12 p11 p10 p9 p8 76543210 p7 p6 p5 p4 p3 p2 p1 p0 31 30 29 28 27 26 25 24 p31 p30 p29 p28 p27 p26 p25 p24 23 22 21 20 19 18 17 16 p23 p22 p21 p20 p19 p18 p17 p16 15 14 13 12 11 10 9 8 p15 p14 p13 p12 p11 p10 p9 p8 76543210 p7 p6 p5 p4 p3 p2 p1 p0
AT75C220 73 pio interrupt mask register register name: pio_imr access type: read-only reset value: 0 this register shows which pins have interrupts enabled. it is updated when interrupts are enabled or disabled by writing to pio_ier or pio_idr. 1 = interrupt is enabled on the corresponding pin. 0 = interrupt is not enabled on the corresponding pin. pio interrupt status register register name: pio_isr access type: read-only reset value: 0 this register indicates for each pin when a logic value change has been detected (rising or falling edge). this is valid whether the pio is selected for the pin or not and whether the pin is an input or an output. the register is reset to zero following a read and at reset. 1 = at least one input change has been detected on the corresponding pin since the register was last read. 0 = no input change has been detected on the corresponding pin since the register was last read. 31 30 29 28 27 26 25 24 p31 p30 p29 p28 p27 p26 p25 p24 23 22 21 20 19 18 17 16 p23 p22 p21 p20 p19 p18 p17 p16 15 14 13 12 11 10 9 8 p15 p14 p13 p12 p11 p10 p9 p8 76543210 p7 p6 p5 p4 p3 p2 p1 p0 31 30 29 28 27 26 25 24 p31 p30 p29 p28 p27 p26 p25 p24 23 22 21 20 19 18 17 16 p23 p22 p21 p20 p19 p18 p17 p16 15 14 13 12 11 10 9 8 p15 p14 p13 p12 p11 p10 p9 p8 76543210 p7 p6 p5 p4 p3 p2 p1 p0
AT75C220 74 usart: universal synchronous/asynchronous receiver/transmitter the AT75C220 provides two identical full-duplex, universal synchronous/asynchronous receiver/transmitters as usart a and usart b. these peripherals sit on the apb bus but are also connected to the asb bus (and hence external memory) via a dedicated dma. the main features are:  programmable baud rate generator  parity, framing and overrun error detection  line break generation and detection  automatic echo, local loopback and remote loopback channel modes  multi-drop mode: address detection and generation  interrupt generation  two dedicated peripheral data controller channels  6-, 7- and 8-bit character length  modem control signals figure 15. usart block diagram pin description each usart channel has external signals as defined in table 22. peripheral data controller receive channel transmit channel control logic interrupt control baud rate generator receiver transmitter amba asb apb usxirq aclk aclk/8 rxd txd sck usart channel baud rate clock pio a modem control nrts ncts nri ndsr ndtr ndcd table 22. usart external signals signal name description type sck usart serial clock. can be configured as input or output. see us_mr i/o txd transmit serial data output rxd receive serial data input
AT75C220 75 note: after a hardware reset, the usart sc and modem pins are not enabled by default (see ? pio: programmable i/o controller ? on page 63). baud rate generator the baud rate generator provides the bit period clock (the baud rate clock) to both the receiver and the transmitter. the baud rate generator can select between external and internal clock sources. the external clock source is sck. the internal clock sources can be either the master clock aclk or the master clock divided by 8 (aclk/8). note: in all cases, if an external clock is used, the duration of each of its levels must be longer than the system clock (aclk) period. the external clock frequency must be at least 2.5 times lower than the system clock. when the usart is programmed to operate in asynchro- nous mode (sync = 0 in the mode register us_mr), the selected clock is divided by 16 times the value (cd) written in us_brgr (baud rate generator register). if us_brgr is set to 0, the baud rate clock is disabled. when the usart is programmed to operate in synchro- nous mode (sync = 1) and the selected clock is internal (usclks[1] = 0 in the mode register us_mr), the baud rate clock is the internal selected clock divided by the value written in us_brgr. if us_brgr is set to 0, the baud rate clock is disabled. in synchronous mode with external clock selected (usclks[1] = 1), the clock is provided directly by the sig- nal on the sck pin. no division is active. the value written in us_brgr has no effect. nrts request to send output ncts clear to send input ndtr data terminal ready output ndsr data set ready input ndcd data carrier detect input nri ring indicator input table 22. usart external signals signal name description type baud rate = selected clock 16 x cd baud rate = selected clock cd table 23. clock generator table required baud rate (bps) cd = 24 x 10 6 / 16 x baud rate actual cd actual baud rate (bps) error (bps) % error 9600 156.25 156 9615.4 15.4 0.16 19200 78.125 78 19230.8 30.8 0.16
AT75C220 76 notes: 1. cd = clock driver 2. for information on obtaining exact baud rates using the value of cd given above, the selected clock frequency must be 23,961,600 hz (23.9616 mhz). figure 16. baud rate generator 38400 39.06 39 38461.5 61.5 0.16 57600 26.04 26 57692.3 92.3 0.16 115200 13.02 13 115384.6 184.6 0.16 table 23. clock generator table required baud rate (bps) cd = 24 x 10 6 / 16 x baud rate actual cd actual baud rate (bps) error (bps) % error usclks [1] 0 0 1 1 mcki mcki/8 sck clk 16-bit counter 0 0 1 baud rate clock sync usclks [1] cd cd out 0 1 divide by 16 sync 0 1 >1 usclks [0]
AT75C220 77 receiver asynchronous receiver the usart is configured for asynchronous operation when sync = 0 (bit 7 of us_mr). in asynchronous mode, the usart detects the start of a received character by sampling the rxd signal until it detects a valid start bit. a low level (space) on rxd is interpreted as a valid start bit if it is detected for more than seven cycles of the sampling clock, which is 16 times the baud rate. hence, a space which is longer than 7/16 of the bit period is detected as a valid start bit. a space which is 7/16 of a bit period or shorter is ignored and the receiver continues to wait for a valid start bit. when a valid start bit has been detected, the receiver sam- ples the rxd at the theoretical mid-point of each bit. it is assumed that each bit lasts 16 cycles of the sampling clock (1-bit period) so the sampling point is eight cycles (0.5-bit periods) after the start of the bit. the first sampling point is therefore 24 cycles (1.5-bit periods) after the falling edge of the start bit was detected. each subsequent bit is sampled 16 cycles (1-bit period) after the previous one. figure 17. asynchronous mode: start bit detection figure 18. asynchronous mode: character reception synchronous receiver when configured for synchronous operation (sync = 1), the receiver samples the rxd signal on each rising edge of the baud rate clock. if a low level is detected, it is consid- ered as a start. data bits, parity bit and stop bit are sam- pled and the receiver waits for the next start bit. see the example in figure 19. receiver ready when a complete character is received, it is transferred to the us_rhr and the rxrdy status bit in us_csr is set. if us_rhr has not been read since the last transfer, the ovre status bit in us_csr is set. parity error each time a character is received, the receiver calculates the parity of the received data bits in accordance with the field par in us_mr. it then compares the result with the received parity bit. if different, the parity error bit pare in us_csr is set. framing error if a character is received with a stop bit at low level and with at least one data bit at high level, a framing error is generated. this sets frame in us_csr. 16 x baud rate clock rxd true start detection d0 sampling d0 d1 d2 d3 d4 d5 d6 d7 rxd true start detection sampling parity bit stop bit example: 8-bit, parity enabled 1 stop 1-bit period 0.5-bit periods
AT75C220 78 time-out this function allows an idle condition on the rxd line to be detected. the maximum delay for which the usart should wait for a new character to arrive while the rxd line is inac- tive (high level) is programmed in us_rtor. when this register is set to 0, no time-out is detected. otherwise, the receiver waits for a first character and then initializes a counter which is decremented at each bit period and reloaded at each byte reception. when the counter reaches 0, the timeout bit in us_csr is set. the user can restart the wait for a first character with the sttto (start time- out) bit in us_cr. calculation of time-out duration: figure 19. synchronous mode: character transmission transmitter the transmitter has the same behavior in both synchro- nous and asynchronous operating modes. start bit, data bits, parity bit and stop bits are serially shifted, lowest sig- nificant bit first, on the falling edge of the serial clock. see the example in figure 20. the number of data bits is selected in the chrl field in us_mr. the parity bit is set according to the par field in us_mr. the number of stop bits is selected in the nbstop field in us_mr. when a character is written to us_thr, it is transferred to the shift register as soon as it is empty. when the transfer occurs, the txrdy bit in us_csr is set until a new char- acter is written to us_thr. if the transmit shift register and us_thr are both empty, the txempty bit in us_csr is set. time-guard the time-guard function allows the transmitter to insert an idle state on the txd line between two characters. the duration of the idle state is programmed in us_ttgr. when this register is set to zero, no time-guard is gener- ated. otherwise, the transmitter holds a high level on txd after each transmitted byte during the number of bit periods programmed in us_ttgr. multi-drop mode when the field par in us_mr equals 11x (binary value), the usart is configured to run in multi-drop mode. in this case, the parity error bit pare in us_csr is set when data is detected with a parity bit set to identify an address byte. pare is cleared with the reset status bits command (rststa) in us_cr. if the parity bit is detected low, identi- fying a data byte, pare is not set. the transmitter sends an address byte (parity bit set) when a send address command (senda) is written to us_cr. in this case, the next byte written to us_thr will be trans- mitted as an address. after this, any byte transmitted will have the parity bit cleared. duration value 4 bit period = d0 d1 d2 d3 d4 d5 d6 d7 rxd true start detection sampling parity bit stop bit example: 8-bit, parity enabled 1 stop sck idle state duration between two characters = time-guard value x bit period
AT75C220 79 figure 20. synchronous and asynchronous mode: character transmission break a break condition is a low signal level which has a duration of at least one character, including start/stop bits and par- ity. transmit break the transmitter generates a break condition on the txd line when sttbrk is set in us_cr. in this case, the char- acter present in the transmit shift register is completed before the line is held low. to cancel a break condition on the txd line, the stpbrk command in us_cr must be set. the usart completes a minimum break duration of one character length. the txd line then returns to high level (idle state) for at least 12 bit periods to ensure that the end of break is correctly detected. then the transmitter resumes normal operation. the break is managed like a character:  the sttbrk and the stpbrk commands are performed only if the transmitter is ready (bit txrdy = 1 in us_csr).  the sttbrk command blocks the transmitter holding register (bit txrdy is cleared in us_csr) until the break has started.  a break is started when the shift register is empty (any previous character is fully transmitted). us_csr.txempty is cleared. the break blocks the transmitter shift register until it is completed (high level for at least 12 bit periods after the stpbrk command is requested). in order to avoid unpredictable states:  sttbrk and stpbrk commands must not be requested at the same time.  once an sttbrk command is requested, further sttbrk commands are ignored until the break is ended (high level for at least 12 bit periods).  all stpbrk commands requested without a previous sttbrk command are ignored.  a byte written into the transmit holding register while a break is pending but not started (bit txrdy = 0 in us_csr) is ignored.  it is not permitted to write new data in the transmit holding register while a break is in progress (stpbrk has not been requested), even though txrdy = 1 in us_csr.  a new sttbrk command must not be issued until an existing break has ended (txempty = 1 in us_csr). the standard break transmission sequence is: 1. wait for the transmitter ready (us_csr.txrdy = 1). 2. send the sttbrk command (write 0x0200 to us_cr). 3. wait for the transmitter ready (bit txrdy = 1 in us_csr). 4. send the stpbrk command (write 0x0400 to us_cr). the next byte can then be sent: 5. wait for the transmitter ready (bit txrdy = 1 in us_csr). 6. send the next byte (write byte to us_thr). each of these steps can be scheduled by using the inter- rupt if the bit txrdy in us_imr is set. for character transmission, the usart channel must be enabled before sending a break. receive break the receiver detects a break condition when all data, parity and stop bits are low. when the low stop bit is detected, the receiver asserts the rxbrk bit in us_csr. an end-of- receive break is detected by a high level for at least 2/16 of a bit period in asynchronous operating mode or at least one sample in synchronous operating mode. rxbrk is also asserted when an end-of-break is detected. both the beginning and the end of a break can be detected by interrupt if the bit rxbrk in register us_imr is set. d0 d1 d2 d3 d4 d5 d6 d7 txd start bit parity bit stop bit example: 8-bit, parity enabled 1 stop baud rate clock
AT75C220 80 interrupt generation each status bit in us_csr has a corresponding bit in us_ier and us_idr that controls the generation of inter- rupts by asserting the usart interrupt line connected to the aic. us_imr indicates the status of the corresponding bits. when a bit is set in us_csr and the same bit is set in us_imr, the interrupt line is asserted. channel modes the usart can be programmed to operate in three differ- ent test modes using the field chmode in us_mr. automatic echo mode allows bit-by-bit re-transmission. when a bit is received on the rxd line, it is sent to the txd line. programming the transmitter has no effect. local loopback mode allows the transmitted characters to be received. txd and rxd pins are not used and the out- put of the transmitter is internally connected to the input of the receiver. the rxd pin level has no effect and the txd pin is held high, as in idle state. remote loopback mode directly connects the rxd pin to the txd pin. the transmitter and the receiver are disabled and have no effect. this mode allows bit-by-bit re-transmis- sion. figure 21. channel modes receiver transmitter disabled rxd txd receiver transmitter disabled rxd txd v dd disabled receiver transmitter disabled rxd txd disabled automatic echo local loopback remote loopback v dd
AT75C220 81 peripheral data controller each usart channel is closely connected to a corre- sponding peripheral data controller channel. one is dedi- cated to the receiver, the other is dedicated to the transmit- ter. note: the pdc is disabled if 9-bit character length is selected (mode9 = 1) in us_mr. the pdc channel is programmed using us_tpr and us_tcr for the transmitter and us_rpr and us_rcr for the receiver. the status of the pdc is given in us_csr by the endtx bit for the transmitter and by the endrx bit for the receiver. the pointer registers us_tpr and us_rpr are used to store the address of the transmit or receive buffers. the counter registers us_tcr and us_rcr are used to store the size of these buffers. the receiver data transfer is triggered by the rxrdy bit and the transmitter data transfer is triggered by txrdy. when a transfer is performed, the counter is decremented and the pointer is incremented. when the counter reaches 0, the status bit is set (endrx for the receiver, endtx for the transmitter in us_csr) and can be programmed to generate an interrupt. transfers are then disabled until a new non-zero counter value is programmed. modem control and status signals ncts: clear to send when low, this indicates that the modem or data set is ready to exchange data. the ncts signal is a modem sta- tus input whose conditions can be tested by the cpu reading bit 4 (cts) of the modem status register. bit 4 is the complement of the ncts signal. bit 0 (dcts) of the modem status register indicates whether the ncts input has changed state since the previous reading of the modem status register. ncts has no effect on the transmitter. in fcm mode when the ncts signal becomes inactive high, the transmission of the current character will be com- pleted then transmission stops. note: whenever the cts bit of the modem status register changes state, an interrupt is generated if the modem status interrupt is enabled. ndcd: data carrier detect when low, this indicates that the data carrier has been detected by the modem or data set. the ndcd signal is a modem status input whose condition can be tested by the cpu reading bit 7 (dcd) of the modem status register. bit 7 is the complement of the ndcd signal. bit 3 (ddcd) of the modem status register indicates whether the ndcd input pin has changed since the previous reading of the modem status register. ndcd has no effect on the receiver. note: whenever the dcd bit of the modem status register changes state, an interrupt is generated if the modem status interrupt is enabled. ndsr: data set ready when low, this informs the modem or data set the usart is ready to communicate. the ndsr signal is a modem status input whose condition can be tested by the cpu reading bit 5 (dsr) of the modem status register. bit 5 is the complement of the ndsr signal. bit 1 (ddsr of the modem status register) indicates whether the ndsr input has changed state since the previous reading of the modem status register. note: whenever the dssr bit of the modem status register changes state, an interrupt is generated if the modem status interrupt is enabled. ndtr: data terminal ready when low, this informs the modem or data set that the usart is ready to communicate. the ndtr output signal can be set to active low by programming bit 0 (dtr) of the modem control register to a high level. a master reset operation sets this signal to its inactive (high) state. loop mode operation holds this signal in its inactive state. nri: ring indicator when low, this indicates that a telephone ringing signal has been received by the modem or data set. the nri signal is a modem status input whose condition can be tested by the cpu reading bit 6 (ri) of the modem status register. bit 6 is the complement of the nri signal. bit 2 (teri) of the modem status register indicates whether the nri input signal has changed from a low to a high state since the pre- vious reading of the modem status register. note: whenever the ri bit of the modem status register changes from a high to a low state, an interrupt is gener- ated if the modem status interrupt is enabled. nrts: request to send when low, this informs the modem or data set that the usart is ready to exchange data. the nrts output signal can be set to an active low by programming bit 1 (rts) of the modem control register. a master reset operation sets this signal to its inactive (high) state. in fcm mode when the last stop bit of a character is transmitted and the trans- mit holding register is empty, the hardware sets nrts inactive high. note: modem control pins must be left high when not used.
AT75C220 82 usart user interface base address usart a: 0xff018000 base address usart b: 0xff01c000 notes: 1. this is either 0x18 or 0x418 depending on the value of bootn and modem control inputs. 2. this depends on the value of modem control input signals, as these are reflected in this register. offset register name description access reset value 0x00 us_cr control register write-only ? 0x04 us_mr mode register read/write 0 0x08 us_ier interrupt enable register write-only ? 0x0c us_idr interrupt disable register write-only ? 0x10 us_imr interrupt mask register read-only 0 0x14 us_csr channel status register read-only 0x18 (1) 0x18 us_rhr receiver holding register read-only 0 0x1c us_thr transmitter holding register write-only ? 0x20 us_brgr baud rate generator register read/write 0 0x24 us_rtor receiver time-out register read/write 0 0x28 us_ttgr transmitter time-guard register read/write 0 0x2c ? reserved ? ? 0x30 us_rpr receive pointer register read/write 0 0x34 us_rcr receive counter register read/write 0 0x38 us_tpr transmit pointer register read/write 0 0x3c us_tcr transmit counter register read/write 0 0x40 us_mc modem control register write-only ? 0x44 us_ms modem status register read-only (see note 2)
AT75C220 83 usart control register name: us_cr access type: write-only reset value: undefined  rstrx: reset receiver 0 = no effect. 1 = the receiver logic is reset.  rsttx: reset transmitter 0 = no effect. 1 = the transmitter logic is reset.  rxen: receiver enable 0 = no effect. 1 = the receiver is enabled if rxdis is 0.  rxdis: receiver disable 0 = no effect. 1 = the receiver is disabled.  txen: transmitter enable 0 = no effect. 1 = the transmitter is enabled if txdis is 0.  txdis: transmitter disable 0 = no effect. 1 = the transmitter is disabled.  rststa: reset status bits 0 = no effect. 1 = resets the status bits pare, frame, ovre and rxbrk in the us_csr.  sttbrk: start break 0 = no effect. 1 = if break is not being transmitted, starts transmission of a break after the characters present in us_thr and the transmit shift register have been transmitted.  stpbrk: stop break 0 = no effect. 1 = if a break is being transmitted, stops transmission of the break after a minimum of one character length and trans- mits a high level during 12 bit periods.  sttto: start time-out 0 = no effect. 1 = starts waiting for a character before clocking the time-out counter.  senda: send address 0 = no effect. 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ??? senda sttto stpbrk sttbrk rststa 76543210 txdis txen rxdis rxen rsttx rstrx ??
AT75C220 84 1 = in multi-drop mode only, the next character written to the us_thr is sent with the address bit set.
AT75C220 85 usart mode register name: us_mr access type: read/write reset value: 0x0  usclks: clock selection (baud rate generator input clock)  chrl: character length start, stop and parity bits are added to the character length.  sync: synchronous mode select 0 = usart operates in asynchronous mode. 1 = usart operates in synchronous mode.  par: parity type 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ????? clko mode9 ? 15 14 13 12 11 10 9 8 chmode nbstop par sync 76543210 chrl usclks ???? usclks selected clock 00 aclk 01 aclk/8 1x external (sck) chrl character length 00 five bits 01 six bits 10 seven bits 11 eight bits pa r par it y ty pe 000 even parity 001 odd parity 010 parity forced to 0 (space) 011 parity forced to 1 (mark) 10x no parity 11x multi-drop mode
AT75C220 86  nbstop: number of stop bits the interpretation of the number of stop bits depends on sync.  chmode: channel mode  mode9: 9-bit character length 0 = chrl defines character length. 1 = 9-bit character length.  cklo: clock output select 0 = the usart does not drive the sck pin. 1 = the usart drives the sck pin if usclks[1] is 0. nbstop asynchronous (sync = 0) synchronous (sync = 1) 0 0 1 stop bit 1 stop bit 0 1 1.5 stop bits reserved 1 0 2 stop bits 2 stop bits 1 1 reserved reserved chmode mode description 0 0 normal mode the usart channel operates as an rx/tx usart. 0 1 automatic echo receiver data input is connected to txd pin. 1 0 local loopback transmitter output signal is connected to receiver input signal. 1 1 remote loopback rxd pin is internally connected to txd pin.
AT75C220 87 usart interrupt enable register name: us_ier access type: write-only reset value: undefined  rxrdy: enable rxrdy interrupt 0 = no effect. 1 = enables rxrdy interrupt.  txrdy: enable txrdy interrupt 0 = no effect. 1 = enables txrdy interrupt.  rxbrk: enable receiver break interrupt 0 = no effect. 1 = enables receiver break interrupt.  endrx: enable end of receive transfer interrupt 0 = no effect. 1 = enables end of receive transfer interrupt.  endtx: enable end of transmit transfer interrupt 0 = no effect. 1 = enables end of transmit transfer interrupt.  ovre: enable overrun error interrupt 0 = no effect. 1 = enables overrun error interrupt.  frame: enable framing error interrupt 0 = no effect. 1 = enables framing error interrupt.  pare: enable parity error interrupt 0 = no effect. 1 = enables parity error interrupt.  timeout: enable time-out interrupt 0 = no effect. 1 = enables reception time-out interrupt.  txempty: enable txempty interrupt 0 = no effect. 1 = enables txempty interrupt.  dmsi: delta modem status indication interrupt 0 = no effect. 1 = enables dmsi interrupt. 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ????? dmsi txempty timeout 76543210 pare frame ovre endtx endrx rxbrk txrdy rxrdy
AT75C220 88 usart interrupt disable register name: us_idr access type: write-only reset value: undefined  rxrdy: disable rxrdy interrupt 0 = no effect. 1 = disables rxrdy interrupt.  txrdy: disable txrdy interrupt 0 = no effect. 1 = disables txrdy interrupt.  rxbrk: disable receiver break interrupt 0 = no effect. 1 = disables receiver break interrupt.  endrx: disable end of receive transfer interrupt 0 = no effect. 1 = disables end of receive transfer interrupt.  endtx: disable end of transmit transfer interrupt 0 = no effect. 1 = disables end of transmit transfer interrupt.  ovre: disable overrun error interrupt 0 = no effect. 1 = disables overrun error interrupt.  frame: disable framing error interrupt 0 = no effect. 1 = disables framing error interrupt.  pare: disable parity error interrupt 0 = no effect. 1 = disables parity error interrupt.  timeout: disable time-out interrupt 0 = no effect. 1 = disables receiver time-out interrupt.  txempty: disable txempty interrupt 0 = no effect. 1 = disables txempty interrupt.  dmsi: delta modem status indication interrupt 0 = no effect. 1 = disables dmsi interrupt. 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ????? dmsi txempty timeout 76543210 pare frame ovre endtx endrx rxbrk txrdy rxrdy
AT75C220 89 usart interrupt mask register name: us_imr access type: read-only reset value: 0x0  rxrdy: rxrdy interrupt mask 0 = rxrdy interrupt is disabled. 1 = rxrdy interrupt is enabled.  txrdy: txrdy interrupt mask 0 = txrdy interrupt is disabled. 1 = txrdy interrupt is enabled.  rxbrk: receiver break interrupt mask 0 = receiver break interrupt is disabled. 1 = receiver break interrupt is enabled.  endrx: end of receive transfer interrupt mask 0 = end of receive transfer interrupt is disabled. 1 = end of receive transfer interrupt is enabled.  endtx: end of transmit transfer interrupt mask 0 = end of transmit transfer interrupt is disabled. 1 = end of transmit transfer interrupt is enabled.  ovre: overrun error interrupt mask 0 = overrun error interrupt is disabled. 1 = overrun error interrupt is enabled.  frame: framing error interrupt mask 0 = framing error interrupt is disabled. 1 = framing error interrupt is enabled.  pare: parity error interrupt mask 0 = parity error interrupt is disabled. 1 = parity error interrupt is enabled.  timeout: time-out interrupt mask 0 = receive time-out interrupt is disabled. 1 = receive time-out interrupt is enabled.  txempty: txempty interrupt mask 0 = txempty interrupt is disabled. 1 = txempty interrupt is enabled.  dmsi: delta modem status indication interrupt 0 = dmsi interrupt is disabled. 1 = dmsi interrupt is enabled. 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ????? dmsi txempty timeout 76543210 pare frame ovre endtx endrx rxbrk txrdy rxrdy
AT75C220 90 usart channel status register name: us_csr access type: read-only reset value: 0x18  rxrdy: receiver ready 0 = no complete character has been received since the last read of the us_rhr or the receiver is disabled. 1 = at least one complete character has been received and the us_rhr has not yet been read.  txrdy: transmitter ready 0 = us_thr contains a character waiting to be transferred to the transmit shift register. 1 = us_thr is empty and there is no break request pending tsr availability. equal to zero when the usart is disabled or at reset. transmitter enable command (in us_cr) sets this bit to one.  rxbrk: break received/end of break 0 = no break received or end of break detected since the last reset status bits command in the control register. 1 = break received or end of break detected since the last reset status bits command in the control register.  endrx: end-of-receive transfer 0 = the end-of-transfer signal from the pdc channel dedicated to the receiver is inactive. 1 = the end-of-transfer signal from the pdc channel dedicated to the receiver is active.  endtx: end-of-transmit transfer 0 = the end-of-transfer signal from the pdc channel dedicated to the transmitter is inactive. 1 = the end-of-transfer signal from the pdc channel dedicated to the transmitter is active.  ovre: overrun error 0 = no byte has been transferred from the receive shift register to the us_rhr when rxrdy was asserted since the last reset status bits command. 1 = at least one byte has been transferred from the receive shift register to the us_rhr when rxrdy was asserted since the last reset status bits command.  frame: framing error 0 = no stop bit has been detected low since the last reset status bits command. 1 = at least one stop bit has been detected low since the last reset status bits command.  pare: parity error 1 = at least one parity bit has been detected false (or a parity bit high in multi-drop mode) since the last reset status bit ? command. 0 = no parity bit has been detected false (or a parity bit high in multi-drop mode) since the last reset status bits command.  timeout: receiver time-out 0 = there has not been a time-out since the last start time-out command or the time-out register is 0. 1 = there has been a time-out since the last start time-out command. 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ????? dmsi txempty timeout 76543210 pare frame ovre endtx endrx rxbrk txrdy rxrdy
AT75C220 91  txempty: transmitter empty 0 = there are characters in either us_thr or the transmit shift register or a break is being transmitted. 1 = there are no characters in us_thr and the transmit shift register and break is not active. equal to zero when the usart is disabled or at reset. transmitter enable command (in us_cr) sets this bit to one.  dmsi: delta modem status indication interrupt 0 = no effect. 1 = there has been a change in the modem status delta bits since the last reset status bits command. usart receiver holding register name: us_rhr access type: read-only reset value: 0x0  rxchr: received character last character received if rxrdy is set. when number of data bits is less than eight, the bits are right-aligned. all unused bits read as zero. usart transmitter holding register name: us_thr access type: write-only reset value: undefined  txchr: character to be transmitted next character to be transmitted after the current character if txrdy is not set. when number of data bits is less than eight, the bits are right-aligned. 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ??????? rxchr 76543210 rxchr 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ??????? txchr 76543210 txchr
AT75C220 92 usart baud rate generator register name: us_brgr access type: read/write reset value: 0x0  cd: clock divisor this register has no effect if synchronous mode is selected with an external clock. note: in synchronous mode, the value programmed must be even to ensure a 50:50 mark-to-space ratio. note: clock divisor bypass (cd = 1) must not be used when internal clock aclk is selected (usclks = 0). 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 cd 76543210 cd cd effect 0 disables clock 1 clock divisor bypass 2 to 65535 baud rate (asynchronous mode) = selected clock/(16 x cd) baud rate (synchronous mode) = selected clock/cd
AT75C220 93 usart receiver time-out register name: us_rtor access type: read/write reset value: 0x0  to: time-out value when a value is written to this register, a start time-out command is automatically performed. time-out duration = to x 4 x bit period 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ???????? 76543210 to to effect 0 disables the rx time-out function. 1 - 255 the time-out counter is loaded with to when the start time-out command is given or when each new data character is received (after reception has started).
AT75C220 94 usart transmitter time-guard register name: us_ttgr access type: read/write reset value: 0x0  tg: time-guard value time-guard duration = tg x bit period usart receive pointer register name: us_rpr access type: read/write reset value: 0x0  rxptr: receive pointer rxptr must be loaded with the address of the receive buffer. 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ???????? 76543210 tg tg effect 0 disables the tx time-guard function. 1 - 255 txd is inactive high after the transmission of each character for the time-guard duration. 31 30 29 28 27 26 25 24 rxptr 23 22 21 20 19 18 17 16 rxptr 15 14 13 12 11 10 9 8 rxptr 76543210 rxptr
AT75C220 95 usart receive counter register name: us_rcr access type: read/write reset value: 0x0  rxctr: receive counter rxctr must be loaded with the size of the receive buffer. 0: stop peripheral data transfer dedicated to the receiver. 1 - 65535: start peripheral data transfer if rxrdy is active. usart transmit pointer register name: us_tpr access type: read/write reset value: 0x0  txptr: transmit pointer txptr must be loaded with the address of the transmit buffer. 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 rxctr 76543210 rxctr 31 30 29 28 27 26 25 24 txptr 23 22 21 20 19 18 17 16 txptr 15 14 13 12 11 10 9 8 txptr 76543210 txptr
AT75C220 96 usart transmit counter register name: us_tcr access type: read/write reset value: 0x0  txctr: transmit counter txctr must be loaded with the size of the transmit buffer. 0: stop peripheral data transfer dedicated to the transmitter. 1 - 65535: start peripheral data transfer if txrdy is active. 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 txctr 76543210 txctr
AT75C220 97 modem control register register name: us_mc access type: write-only reset value: undefined this register controls the interface with the modem or data set (or a peripheral device emulating a modem). the contents of the control register are indicated below.  dtr: data terminal ready this bit controls the ndtr output. when bit 0 is set to a logic 1, the ndtr output is forced to a logic 0. when bit 0 is reset to a logic 0, the ndtr output is forced to a logic 1. note: the ndtr output of the uart can be applied to an eia inverting line driver to obtain proper polarity input at the succeedi ng modem or data set.  rts: request to send this bit controls the nrts output. bit 1 affects the nrts output in a manner identical to that described above for bit 0.  fcm: flow control mode when fcm is set high, the hardware can perform operations automatically depending on the state of ncts and char- acter transmission logic. such changes take place immediately and are reflected in the values read in the modem status register. this flag is set low at reset. in flow control mode, transmission should occur only if ncts is active. 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ???????? 76543210 ?? fcm ??? rts dtr
AT75C220 98 modem status register register name: us_ms access type: read-only reset value: undefined this register provides the current state of the control lines from the modem (or peripheral device) to the cpu. in addition to this current-state information, four bits of the modem status register provide change information. these bits are set to a logic 1 whenever a control input from the modem changes state. they are reset to logic 0 whenever the cpu reads the modem status register.  dcts: delta clear to send bit 0 indicates that the ncts input to the chip has changed state since the last time it was read by the cpu.  ddsr: delta data set ready bit 1 indicates that the ndsr input to the chip has changed state since the last time it was read by the cpu.  teri: trailing edge ring indicator bit 2 indicates that the nri input to the chip has changed from a low to a high state.  ddcd: delta data carrier detect bit 3 indicates that the ndcd input has changed state. note that whenever bit 0, 1, 2, or 3 is set to logic 1, a modem status interrupt is generated. this is reflected in the modem status register.  cts: clear to send this bit is the complement of the clear to send (ncts) input.  dsr: data set ready this bit is the complement of the data set ready (ndsr) input.  ri: ring indicator this bit is the complement of the ring indicator (nri) input.  dcd: data carrier detect this bit is the complement of the data carrier detect (ndcd) input.  fcms: flow control status this bit indicates the value of the fcm in the us_mc. 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ??????? fcms 76543210 dcd ri dsr cts ddcd teri ddsr dcts
AT75C220 99 tc: timer/counter the AT75C220 features a timer/counter block which includes three identical 16-bit timer/counter channels. each channel can be independently programmed to perform a wide range of functions including frequency measurement, event counting, interval measurement, pulse generation, delay timing and pulse-width modulation. each timer/counter channel has three external clock inputs, five internal clock inputs, and two multi-purpose input/out- put signals that can be configured by the user. each chan- nel drives an internal interrupt signal that can be pro- grammed to generate processor interrupts via the aic. the timer/counter block has two global registers which act upon all three tc channels. the block control register allows the three channels to be started simultaneously with the same instruction. the block mode register defines the external clock inputs for each timer/counter channel, allow- ing them to be chained. figure 22. timer/counter block diagram timer/counter channel 0 timer/counter channel 1 timer/counter channel 2 sync parallel i/o controller tc1xc1s tc0xc0s tc2xc2s int int int tioa0 tioa1 tioa2 tiob0 tiob1 tiob2 xc0 xc1 xc2 xc0 xc1 xc2 xc0 xc1 xc2 tclk0 tclk1 tclk2 tclk0 tclk1 tclk2 tclk0 tclk1 tclk2 tioa1 tioa2 tioa0 tioa2 tioa0 tioa1 advanced interrupt controller tclk0 tclk1 tclk2 tioa0 tiob0 tioa1 tiob1 tioa2 tiob2 timer/counter block tioa tiob tioa tiob tioa tiob sync sync aclk/2 aclk/8 aclk/32 aclk/128 aclk/1024
AT75C220 100 signal name description note: after a hardware reset, the timer/counter block pins are controlled by the pio controller. they must be configured to be c on- trolled by the peripheral before being used. timer/counter description the three timer/counter channels are independent and identical in operation. the registers for channel program- ming are listed in table 25 on page 106. counter each timer/counter channel is organized around a 16-bit counter. the value of the counter is incremented at each positive edge of the selected clock. when the counter has reached the value 0xffff and passes to 0x0000, an over- flow occurs and the bit covfs in tc_sr (status register) is set. the current value of the counter is accessible in real time by reading tc_cv. the counter can be reset by a trigger. in this case, the counter value passes to 0x0000 on the next valid edge of the selected clock. clock selection at block level, input clock signals of each channel can either be connected to the external inputs tclk0, tclk1 or tclk2, or be connected to the configurable i/o signals tioa0, tioa1 or tioa2 for chaining by programming the tc_bmr (block mode). each channel can independently select an internal or exter- nal clock source for its counter:  internal clock signals: aclk/2, aclk/8, aclk/32, aclk/128, aclk/1024  external clock signals: xc0, xc1 or xc2 the selected clock can be inverted with the clki bit in tc_cmr (channel mode). this allows counting on the opposite edges of the clock. the burst function allows the clock to be validated when an external signal is high. the burst parameter in the mode register defines this signal (none, xc0, xc1, xc2). note: in all cases, if an external clock is used, the duration of each of its levels must be longer than the system clock (aclk) period. the external clock frequency must be at least 2.5 times lower than the system clock (aclk). channel signal description ty p e xc0, xc1, xc2 external clock inputs i tioa capture mode: general-purpose input waveform mode: general-purpose output i o tiob capture mode: general-purpose input waveform mode: general-purpose input/output i o int interrupt signal output o sync synchronization input signal i block signal tclk0, tclk1, tclk2 external clock inputs i tioa0 tioa signal for channel 0 i/o tiob0 tiob signal for channel 0 i/o tioa1 tioa signal for channel 1 i/o tiob1 tiob signal for channel 1 i/o tioa2 tioa signal for channel 2 i/o tiob2 tiob signal for channel 2 i/o
AT75C220 101 figure 23. clock selection clock control the clock of each counter can be controlled in two different ways: it can be enabled/disabled and started/stopped. 1. the clock can be enabled or disabled by the user with the clken and the clkdis commands in the control register. in capture mode it can be disabled by an rb load event if ldbdis is set to 1 in tc_cmr. in waveform mode it can be disabled by an rc compare event if cpcdis is set to 1 in tc_cmr. when disabled, the start or the stop actions have no effect: only a clken command in the control register can re-enable the clock. when the clock is enabled, the clksta bit is set in the status register. 2. the clock can also be started or stopped: a trigger (software, synchro, external or compare) always starts the clock. the clock can be stopped by an rb load event in capture mode (ldbstop = 1 in tc_cmr) or a rc compare event in waveform mode (cpcstop = 1 in tc_cmr). the start and the stop commands have an effect only if the clock is enabled. timer/counter operating modes each timer/counter channel can independently operate in two different modes: 1. capture mode allows measurement on signals 2. waveform mode allows wave generation the timer/counter operating mode is programmed with the wave bit in the tc mode register. in capture mode, tioa and tiob are configured as inputs. in waveform mode, tioa is always configured to be an output and tiob is an output if it is not selected to be the external trigger. figure 24. clock control trigger a trigger resets the counter and starts the counter clock. three types of triggers are common to both modes, and a fourth external trigger is available to each mode. the following triggers are common to both modes: 1. software trigger: each channel has a software trig- ger, available by setting swtrg in tc_ccr. 2. sync: each channel has a synchronization signal, sync. when asserted, this signal has the same effect as a software trigger. the sync signals of all channels are asserted simultaneously by writing tc_bcr (block control) with sync set. 3. compare rc trigger: rc is implemented in each channel and can provide a trigger when the counter value matches the rc value if cpctrg is set in tc_cmr. the timer/counter channel can also be configured to have an external trigger. in capture mode, the external trigger signal can be selected between tioa and tiob. in wave- form mode, an external event can be programmed on one of the following signals: tiob, xc0, xc1 or xc2. this external event can then be programmed to perform a trig- ger by setting enetrg in tc_cmr. if an external trigger is used, the duration of the pulses must be longer than the system clock (aclk) period in order to be detected. whatever the trigger used, it will be taken into account at the following active edge of the selected clock. this means that the counter value may not read zero just after a trigger, especially when a low-frequency signal is selected as the clock. aclk/2 aclk/8 aclk/32 aclk/128 aclk/1024 xc0 xc1 xc2 clks clki burst 1 selected clock qs r s r q clksta clken clkdis stop event disable event counter clock selected clock trigger
AT75C220 102 capture operating mode this mode is entered by clearing the wave parameter in tc_cmr (channel mode register). capture mode allows the tc channel to perform measurements such as pulse timing, frequency, period, duty cycle and phase on tioa and tiob signals which are inputs. figure 25 shows the configuration of the tc channel when programmed in capture mode. capture registers a and b (ra and rb) registers a and b are used as capture registers. this means that they can be loaded with the counter value when a programmable event occurs on the signal tioa. the parameter ldra in tc_cmr defines the tioa edge for the loading of register a, and the parameter ldrb defines the tioa edge for the loading of register b. ra is loaded only if it has not been loaded since the last trigger or if rb has been loaded since the last loading of ra. rb is loaded only if ra has been loaded since the last trig- ger or the last loading of rb. loading ra or rb before the read of the last value loaded sets the overrun error flag (lovrs) in tc_sr (status register). in this case, the old value is overwritten. trigger conditions in addition to the sync signal, the software trigger and the rc compare trigger, an external trigger can be defined. bit abetrg in tc_cmr selects input signal tioa or tiob as an external trigger. parameter etrgedg defines the edge (rising, falling or both) detected to generate an exter- nal trigger. if etrgedg = 0 (none), the external trigger is disabled. status register the following bits in the status register are significant in capture operating mode.  cpcs: rc compare status there has been an rc compare match at least once since the last read of the status.  covfs: counter overflow status the counter has attempted to count past $ffff since the last read of the status.  lovrs: load overrun status ra or rb has been loaded at least twice without any read of the corresponding register since the last read of the status.  ldras: load ra status ra has been loaded at least once without any read since the last read of the status.  ldrbs: load rb status rb has been loaded at least once without any read since the last read of the status.  etrgs: external trigger status an external trigger on tioa or tiob has been detected since the last read of the status.
AT75C220 103 figure 25. capture mode aclk/2 aclk/8 aclk/32 aclk/128 aclk/1024 xc0 xc1 xc2 tcclks clki qs r s r q clksta clken clkdis burst tiob register c capture register a capture register b compare rc = 16-bit counter abetrg swtrg etrgedg cpctrg tc_imr trig ldrbs ldras etrgs tc_sr lovrs covfs sync 1 mtiob tioa mtioa ldra ldbstop if ra is not loaded or rb is loaded if ra is loaded ldbdis cpcs int edge detector edge detector ldrb edge detector clk ovf reset timer/counter channel
AT75C220 104 waveform operating mode this mode is entered by setting the wave parameter in tc_cmr (channel mode register). waveform operating mode allows the tc channel to gener- ate 1 or 2 pwm signals with the same frequency and inde- pendently programmable duty cycles or to generate differ- ent types of one-shot or repetitive pulses. in this mode, tioa is configured as output and tiob is defined as output if it is not used as an external event (eevt parameter in tc_cmr). figure 26 shows the configuration of the tc channel when programmed in waveform operating mode. compare register a, b and c (ra, rb, and rc) in waveform operating mode, ra, rb and rc are all used as compare registers. ra compare is used to control the tioa output. rb com- pare is used to control the tiob (if configured as output). rc compare can be programmed to control tioa and/or tiob outputs. rc compare can also stop the counter clock (cpcstop = 1 in tc_cmr) and/or disable the counter clock (cpcdis = 1 in tc_cmr). as in capture mode, rc compare can also generate a trig- ger if cpctrg = 1. a trigger resets the counter so rc can control the period of pwm waveforms. external event/trigger conditions an external event can be programmed to be detected on one of the clock sources (xc0, xc1, xc2) or tiob. the external event selected can then be used as a trigger. the parameter eevt in tc_cmr selects the external trig- ger. the parameter eevtedg defines the trigger edge for each of the possible external triggers (rising, falling or both). if eevtedg is cleared (none), no external event is defined. if tiob is defined as an external event signal (eevt = 0), tiob is no longer used as output and the tc channel can only generate a waveform on tioa. when an external event is defined, it can be used as a trig- ger by setting bit enetrg in tc_cmr. as in capture mode, the sync signal, the software trigger and the rc compare trigger are also available as triggers. output controller the output controller defines the output level changes on tioa and tiob following an event. tiob control is used only if tiob is defined as output (not as an external event). the following events control tioa and tiob: software trig- ger, external event and rc compare. ra compare controls tioa and rb compare controls tiob. each of these events can be programmed to set, clear or toggle the out- put as defined in the corresponding parameter in tc_cmr. the tables below show which parameter in tc_cmr is used to define the effect of each event. if two or more events occur at the same time, the priority level is defined as follows: 1. software trigger 2. external event 3. rc compare 4. ra or rb compare status the following bits in the status register are significant in waveform mode:  cpas: ra compare status there has been a ra compare match at least once since the last read of the status  cpbs: rb compare status there has been a rb compare match at least once since the last read of the status  cpcs: rc compare status there has been a rc compare match at least once since the last read of the status  covfs: counter overflow counter has attempted to count past $ffff since the last read of the status  etrgs: external trigger external trigger has been detected since the last read of the status parameter tioa event aswtrg software trigger aeevt external event acpc rc compare acpa ra compare parameter tiob event bswtrg software trigger beevt external event bcpc rc compare bcpb rb compare
AT75C220 105 figure 26. waveform mode aclk/2 aclk/8 aclk/32 aclk/128 aclk/1024 xc0 xc1 xc2 tcclks clki qs r s r q clksta clken clkdis cpcdis burst tiob register a register b register c compare ra = compare rb = compare rc = cpcstop 16-bit counter eevt eevtedg sync swtrg enetrg cpctrg tc_imr trig acpc acpa aeevt aswtrg bcpc bcpb beevt bswtrg tioa mtioa tiob mtiob cpas covfs etrgs tc_sr cpcs cpbs clk ovf reset output controller output controller int 1 edge detector timer/counter channel
AT75C220 106 tc user interface tc base address: 0xff014000 tc_bcr and tc_bmr control the tc block. tc channels are controlled by the registers listed in table 25. the offset of each of the channel registers in table 25 is in relation to the offset of the corresponding channel as stated in table 24. note: 1. read only if wave = 0 table 24. tc global memory map offset register name channel/register access reset value 0x00 see table 25 tc channel 0 see table 25 0x40 see table 25 tc channel 1 see table 25 0x80 see table 25 tc channel 2 see table 25 0xc0 tc_bcr tc block control register write-only ? 0xc4 tc_bmr tc block mode register read/write 0 table 25. tc channel memory map offset register name description access reset value 0x00 tc_ccr channel control register write-only ? 0x04 tc_cmr channel mode register read/write 0 0x08 reserved ? 0x0c reserved ? 0x10 tc_cvr counter value register read/write 0 0x14 tc_ra register a read/write (1) 0 0x18 tc_rb register b read/write (1) 0 0x1c tc_rc register c read/write 0 0x20 tc_sr status register read-only ? 0x24 tc_ier interrupt enable register write-only ? 0x28 tc_idr interrupt disable register write-only ? 0x2c tc_imr interrupt mask register read-only 0
AT75C220 107 tc block control register register name: tc_bcr access type: write-only  sync: synchro command 0 = no effect. 1 = asserts the sync signal which generates a software trigger simultaneously for each of the channels. 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ???????? 76543210 ??????? sync
AT75C220 108 tc block mode register register name: tc_bmr access type: read/write reset value: 0x0  tc0xc0s: external clock signal 0 selection  tc1xc1s: external clock signal 1 selection  tc2xc2s: external clock signal 2 selection 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ???????? 76543210 ?? tc2xc2s tc1xc1s tc0xc0s tc0xc0s signal connected to xc0 00tclk0 01none 10tioa1 11tioa2 tc1xc1s signal connected to xc1 00tclk1 0 1 none 10tioa0 11tioa2 tc2xc2s signal connected to xc2 00tclk2 0 1 none 10tioa0 11tioa1
AT75C220 109 tc channel control register register name: tc_ccr access type: write-only  clken: counter clock enable command 0 = no effect. 1 = enables the clock if clkdis is not 1.  clkdis: counter clock disable command 0 = no effect. 1 = disables the clock.  swtrg: software trigger command 0 = no effect. 1 = a software trigger is performed: the counter is reset and clock is started. 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ???????? 76543210 ????? swtrg clkdis clken
AT75C220 110 tc channel mode register: capture mode register name: tc_cmr access type: read/write reset value: 0x0  tcclks: clock selection  clki: clock invert 0 = counter is incremented on rising edge of the clock. 1 = counter is incremented on falling edge of the clock.  burst: burst signal selection  ldbstop: counter clock stopped with rb loading 0 = counter clock is not stopped when rb loading occurs. 1 = counter clock is stopped when rb loading occurs.  ldbdis: counter clock disable with rb loading 0 = counter clock is not disabled when rb loading occurs. 1 = counter clock is disabled when rb loading occurs. 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???? ldrb ldra 15 14 13 12 11 10 9 8 wave cpctrg ??? abetrg etrgedg 76543210 ldbdis ldbstop burst clki tcclks tcclks clock selected 000aclk/2 001aclk/8 010aclk/32 0 1 1 aclk/128 1 0 0 aclk/1024 101xc0 110xc1 111xc2 burst 0 0 the clock is not gated by an external signal. 0 1 xc0 is anded with the selected clock. 1 0 xc1 is anded with the selected clock. 1 1 xc2 is anded with the selected clock.
AT75C220 111  etrgedg: external trigger edge selection  abetrg: tioa or tiob external trigger selection 0 = tiob is used as an external trigger. 1 = tioa is used as an external trigger.  cpctrg: rc compare trigger enable 0 = rc compare has no effect on the counter and its clock. 1 = rc compare resets the counter and starts the counter clock.  wave 0 = capture mode is enabled. 1 = capture mode is disabled (waveform mode is enabled).  ldra: ra loading selection  ldrb: rb loading selection etrgedg edge 0 0 none 0 1 rising edge 1 0 falling edge 1 1 each edge ldra edge 0 0 none 0 1 rising edge of tioa 1 0 falling edge of tioa 1 1 each edge of tioa ldrb edge 00none 0 1 rising edge of tioa 1 0 falling edge of tioa 1 1 each edge of tioa
AT75C220 112 tc channel mode register: waveform mode register name: tc_cmr access type: read/write reset value: 0x0  tcclks: clock selection  clki: clock invert 0 = counter is incremented on rising edge of the clock. 1 = counter is incremented on falling edge of the clock.  burst: burst signal selection  cpcstop: counter clock stopped with rc compare 0 = counter clock is not stopped when counter reaches rc. 1 = counter clock is stopped when counter reaches rc.  cpcdis: counter clock disable with rc compare 0 = counter clock is not disabled when counter reaches rc. 1 = counter clock is disabled when counter reaches rc. 31 30 29 28 27 26 25 24 bswtrg beevt bcpc bcpb 23 22 21 20 19 18 17 16 aswtrg aeevt acpc acpa 15 14 13 12 11 10 9 8 wave cpctrg ? enetrg eevt eevtedg 76543210 cpcdis cpcstop burst clki tcclks tcclks clock selected 000aclk/2 001aclk/8 010aclk/32 0 1 1 aclk/128 1 0 0 aclk/1024 101xc0 110xc1 111xc2 burst 0 0 the clock is not gated by an external signal. 0 1 xc0 is anded with the selected clock. 1 0 xc1 is anded with the selected clock. 1 1 xc2 is anded with the selected clock.
AT75C220 113  eevtedg: external event edge selection  eevt: external event selection note: 1. if tiob is chosen as the external event signal, it is configured as an input and no longer generates waveforms.  enetrg: external event trigger enable 0 = the external event has no effect on the counter and its clock. in this case, the selected external event only controls the tioa output. 1 = the external event resets the counter and starts the counter clock.  cpctrg: rc compare trigger enable 0 = rc compare has no effect on the counter and its clock. 1 = rc compare resets the counter and starts the counter clock.  wave 0 = waveform mode is disabled (capture mode is enabled). 1 = waveform mode is enabled.  acpa: ra compare effect on tioa  acpc: rc compare effect on tioa eevtedg edge 00none 0 1 rising edge 1 0 falling edge 1 1 each edge eevt signal selected as external event tiob direction 0 0 tiob input (1) 0 1 xc0 output 1 0 xc1 output 1 1 xc2 output acpa effect 0 0 none 01set 10clear 11toggle acpc effect 00none 01set 1 0 clear 1 1 toggle
AT75C220 114  aeevt: external event effect on tioa  aswtrg: software trigger effect on tioa  bcpb: rb compare effect on tiob  bcpc: rc compare effect on tiob  beevt: external event effect on tiob aeevt effect 00none 01set 10clear 11toggle aswtrg effect 00none 01set 10clear 11toggle bcpb effect 00none 01set 10clear 11toggle bcpc effect 00none 01set 10clear 1 1 toggle beevt effect 00none 01set 10clear 1 1 toggle
AT75C220 115  bswtrg: software trigger effect on tiob tc counter value register register name: tc_cvr access type: read-only  cv: counter value cv contains the counter value in real-time. bswtrg effect 00none 01set 1 0 clear 1 1 toggle 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 cv 76543210 cv
AT75C220 116 tc register a register name: tc_ra access type: read-only if wave = 0, read/write if wave = 1 reset value: 0x0  ra: register a ra contains the register a value in real-time. tc register b register name: tc_rb access type: read-only if wave = 0, read/write if wave = 1 reset value: 0x0  rb: register b rb contains the register b value in real-time. tc register c register name: tc_rc access type: read/write reset value: 0x0  rc: register c rc contains the register c value in real-time. 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ra 76543210 ra 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 rb 76543210 rb 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 rc 76543210 rc
AT75C220 117 tc status register register name: tc_sr access type: read-only  covfs: counter overflow status 0 = no counter overflow has occurred since the last read of the status register. 1 = a counter overflow has occurred since the last read of the status register.  lovrs: load overrun status 0 = load overrun has not occurred since the last read of the status register or wave = 1. 1 = ra or rb have been loaded at least twice without any read of the corresponding register since the last read of the status register if wave = 0.  cpas: ra compare status 0 = ra compare has not occurred since the last read of the status register or wave = 0. 1 = ra compare has occurred since the last read of the status register if wave = 1.  cpbs: rb compare status 0 = rb compare has not occurred since the last read of the status register or wave = 0. 1 = rb compare has occurred since the last read of the status register if wave = 1.  cpcs: rc compare status 0 = rc compare has not occurred since the last read of the status register. 1 = rc compare has occurred since the last read of the status register.  ldras: ra loading status 0 = ra load has not occurred since the last read of the status register or wave = 1. 1 = ra load has occurred since the last read of the status register, if wave = 0.  ldrbs: rb loading status 0 = rb load has not occurred since the last read of the status register or wave = 1. 1 = rb load has occurred since the last read of the status register if wave = 0.  etrgs: external trigger status 0 = external trigger has not occurred since the last read of the status register. 1 = external trigger has occurred since the last read of the status register.  clksta: clock enabling status 0 = clock is disabled. 1 = clock is enabled.  mtioa: tioa mirror 0 = tioa is low. if wave = 0, then tioa pin is low. if wave = 1, then tioa is driven low. 1 = tioa is high. if wave = 0, then tioa pin is high. if wave = 1, then tioa is driven high.  mtiob: tiob mirror 0 = tiob is low. if wave = 0, then tiob pin is low. if wave = 1, then tiob is driven low. 1 = tiob is high. if wave = 0, then tiob pin is high. if wave = 1, then tiob is driven high. 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ????? mtiob mtioa clksta 15 14 13 12 11 10 9 8 ???????? 76543210 etrgs ldrbs ldras cpcs cpbs cpas lovrs covfs
AT75C220 118 tc interrupt enable register register name: tc_ier access type: write-only  covfs: counter overflow 0 = no effect. 1 = enables the counter overflow interrupt.  lovrs: load overrun 0 = no effect. 1: enables the load overrun interrupt.  cpas: ra compare 0 = no effect. 1 = enables the ra compare interrupt.  cpbs: rb compare 0 = no effect. 1 = enables the rb compare interrupt.  cpcs: rc compare 0 = no effect. 1 = enables the rc compare interrupt.  ldras: ra loading 0 = no effect. 1 = enables the ra load interrupt.  ldrbs: rb loading 0 = no effect. 1 = enables the rb load interrupt.  etrgs: external trigger 0 = no effect. 1 = enables the external trigger interrupt. 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ???????? 76543210 etrgs ldrbs ldras cpcs cpbs cpas lovrs covfs
AT75C220 119 tc interrupt disable register register name: tc_idr access type: write-only  covfs: counter overflow 0 = no effect. 1 = disables the counter overflow interrupt.  lovrs: load overrun 0 = no effect. 1 = disables the load overrun interrupt if wave = 0.  cpas: ra compare 0 = no effect. 1 = disables the ra compare interrupt if wave = 1.  cpbs: rb compare 0 = no effect. 1 = disables the rb compare interrupt if wave = 1.  cpcs: rc compare 0 = no effect. 1 = disables the rc compare interrupt.  ldras: ra loading 0 = no effect. 1 = disables the ra load interrupt if wave = 0.  ldrbs: rb loading 0 = no effect. 1 = disables the rb load interrupt if wave = 0.  etrgs: external trigger 0 = no effect. 1 = disables the external trigger interrupt. 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ???????? 76543210 etrgs ldrbs ldras cpcs cpbs cpas lovrs covfs
AT75C220 120 tc interrupt mask register register name: tc_imr access type: read-only reset value: 0x0  covfs: counter overflow 0 = the counter overflow interrupt is disabled. 1 = the counter overflow interrupt is enabled.  lovrs: load overrun 0 = the load overrun interrupt is disabled. 1 = the load overrun interrupt is enabled.  cpas: ra compare 0 = the ra compare interrupt is disabled. 1 = the ra compare interrupt is enabled.  cpbs: rb compare 0 = the rb compare interrupt is disabled. 1 = the rb compare interrupt is enabled.  cpcs: rc compare 0 = the rc compare interrupt is disabled. 1 = the rc compare interrupt is enabled.  ldras: ra loading 0 = the load ra interrupt is disabled. 1 = the load ra interrupt is enabled.  ldrbs: rb loading 0 = the load rb interrupt is disabled. 1 = the load rb interrupt is enabled.  etrgs: external trigger 0 = the external trigger interrupt is disabled. 1 = the external trigger interrupt is enabled. 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ???????? 76543210 etrgs ldrbs ldras cpcs cpbs cpas lovrs covfs
AT75C220 121 spi: serial peripheral interface the AT75C220 integrates a serial peripheral interface (spi) that provides communication with external devices in master or slave mode. typically it is used to connect to external processors or serial flash. figure 27. serial peripheral interface block diagram note: after a hardware reset, the spi pins npcs[3:1] are not enabled by default and must be programmed via the pioa controller. serial peripheral interface apb aclk aclk/32 miso miso mosi mosi spck spck npcss npcss npcs1 npcs1 int advanced interrupt controller npcs2 npcs3 npcs2 npcs3 table 26. spi interface pins pin name description mode function miso master in/slave out master slave serial data input to spi serial data output from spi mosi master out/slave in master slave serial data output from spi serial data input to spi spck serial clock master slave clock output from spi clock input to spi npcss peripheral chip select/ slave select master master slave output: selects peripheral input: low causes mode fault input: chip select for spi npcs[3:1] peripheral chip selects master extra selects
AT75C220 122 master mode in master mode, the spi controls data transfers to and from the slave(s) connected to the spi bus. the spi drives the chip select(s) to the slave(s) and the serial clock (spck). after enabling the spi, a data transfer begins when the arm core writes to the sp_tdr. for details on the spi memory map, refer to table 27 on page 127. transmit and receive buffers maintain the data flow at a constant rate with a reduced requirement for high-priority interrupt servicing. when new data is available in the sp_tdr, the spi continues to transfer data. if the sp_rdr has not been read before new data is received, the overrun error (ovres) flag is set. the delay between the activation of the chip select and the start of the data transfer (dlybs) as well as the delay between each data transfer (dlybct) can be programmed for each of the four external chip selects. all data transfer characteristics including the two timing values are pro- grammed in registers sp_csr0 to sp_csr. in master mode, the peripheral selection can be defined in two different ways: 1. fixed peripheral select: the spi exchanges data with only one peripheral. 2. variable peripheral select: data can be exchanged with more than one peripheral. figure 28 and figure 29 show the operation of the spi in master mode. for details concerning the flag and control bits in these diagrams, see table 27. fixed peripheral select this mode is ideal for transferring memory blocks without the extra overhead in the transmit data register to deter- mine the peripheral. fixed peripheral select is activated by setting bit ps to zero in sp_mr. the peripheral is defined by the pcs field, also in sp_mr. this option is only available when the spi is programmed in master mode. variable peripheral select variable peripheral select is activated by setting bit ps to one. the pcs field in sp_tdr is used to select the desti- nation peripheral. the data transfer characteristics are changed when the selected peripheral changes according to the associated chip select register. the pcs field in the sp_mr has no effect. this option is only available when the spi is programmed in master mode. chip selects the chip select lines are driven by the spi only if it is pro- grammed in master mode. these lines are used to select the destination peripheral. the pcsdec field in sp_mr selects only one peripheral. if variable peripheral select is active, the chip select signals are defined for each transfer in the pcs field in sp_tdr. chip select signals can thus be defined independently for each transfer. if fixed peripheral select is active, chip select signals are defined for all transfers by the field pcs in sp_mr. if a transfer with a new peripheral is necessary, the software must wait until the current transfer is completed, then change the value of pcs in sp_mr before writing new data in sp_tdr. the value on the npcs pins at the end of each transfer can be read in the sp_rdr. by default, all npcs signals are high (equal to one) before and after each transfer. mode fault detection a mode fault is detected when the spi is programmed in master mode and a low level is driven by an external mas- ter on the npcs0/nss signal. when a mode fault is detected, the modf bit in the sp_sr is set until the sp_sr is read and the spi is disabled until re-enabled by bit spien in the sp_cr.
AT75C220 123 figure 28. functional flow diagram in master mode spi enable tdre ps 1 0 0 1 1 1 0 same peripheral new peripheral npcs = sp_tdr(pcs) npcs = sp_mr(pcs) delay dlybs serializer = sp_tdr(td) tdre = 1 data transfer sp_rdr(rd) = serializer rdrf = 1 tdre ps npcs = 0xf delay dlybcs sp_tdr(pcs) npcs = 0xf delay dlybcs npcs = sp_tdr(pcs) fixed peripheral variable peripheral fixed peripheral variable peripheral delay dlybct 0
AT75C220 124 figure 29. spi in master mode 0 1 sp_mr(aclk32) aclk aclk/32 spck clock generator sp_csrx[15:0] s r q m o d f t d r e r d r f o v r e s p i e n s 0 1 sp_mr(ps) pcs sp_rdr serializer miso sp_mr(pcs) spidis spien sp_mr(mstr) sp_ier sp_idr sp_imr sp_sr mosi npcs1 npcss lsb msb spck spirq spi master clock rd pcs sp_tdr td
AT75C220 125 slave mode in slave mode, the spi waits for npcss to go active low before receiving the serial clock from an external master. cpol, ncpha and bits fields of sp_csr0 are used to define the transfer characteristics. the other chip select registers are not used in slave mode. figure 30. spi in slave mode s r q t d r e r d r f o v r e s p i e n s serializer sck spidis spien sp_ier sp_idr sp_imr sp_sr miso lsb msb nss mosi spirq sp_rdr rd sp_tdr td
AT75C220 126 data transfer figure 31, figure 32 and figure 33 show examples of data transfers. figure 31. spi transfer format (npcha equals one, eight bits per transfer) figure 32. spi transfer format (ncpha equals zero, eight bits per transfer) spck (cpol=0) spck (cpol=1) 1 234 5 67 mosi (from master) miso (from slave) npcss (to slave) spck cycle (for reference) 8 msb msb lsb lsb 6 6 6 5 5 4 4 3 3 2 2 1 1 x spck (cpol=0) spck (cpol=1) 1 234 5 67 mosi (from master) miso (from slave) npcss (to slave) spck cycle (for reference) 8 msb msb lsb lsb 6 6 6 5 5 4 4 3 3 2 2 1 1 x
AT75C220 127 figure 33. programmable delays (dlybcs, dlybs and dltbct) clock generation in master mode, the spi master clock is either aclk or aclk/32, as defined by the mck32 field of sp_mr. the spi baud rate clock is generated by dividing the spi master clock by a value between 4 and 510. the divisor is defined in the scbr field in each chip select register. the transfer speed can thus be defined independently for each chip select signal. cpol and ncpha in the chip select registers define the clock/data relationship between master and slave devices. cpol defines the inactive value of the spck. ncpha defines which edge causes data to change and which edge causes data to be captured. in slave mode, the input clock low and high pulse duration must strictly be longer than two system clock (aclk) peri- ods. peripheral data controller the spi is closely connected to two pdc channels. one is dedicated to the receiver. the other is dedicated to the transmitter. the pdc channel is programmed using sp_tpr and sp_tcr for the transmitter and sp_rpr and sp_rcr for the receiver. the status of the pdc is given in sp_sr by the spendtx bit for the transmitter and by the spendrx bit for the receiver. the pointer registers, sp_tpr and sp_rpr, are used to store the address of the transmit or receive buffers. the counter registers, sp_tcr and sp_rcr, are used to store the size of these buffers. the receiver data transfer is triggered by the rdrf bit and the transmitter data transfer is triggered by tdre. when a transfer is performed, the counter is decremented and the pointer is incremented. when the counter reaches 0, the status bit is set (spendrx for the receiver, spendtx for the transmitter in sp_sr) and can be programmed to gen- erate an interrupt. while the counter is at zero, the status bit is asserted and transfers are disabled spi programmer ? s model spi base address: 0xff020000. chip select 1 chip select 2 spck output dlybcs dlybs dlybct change peripheral no change of peripheral dlybct table 27. spi memory map offset register name register access reset value 0x00 sp_cr control register write-only ? 0x04 sp_mr mode register read/write 0 0x08 sp_rdr receive data register read-only 0 0x0c sp_tdr transmit data register write-only ? 0x10 sp_sr status register read-only 0 0x14 sp_ier interrupt enable register write-only ? 0x18 sp_idr interrupt disable register write-only ? 0x1c sp_imr interrupt mask register read-only 0
AT75C220 128 spi control register register name: sp_cr access type: write-only  spien: spi enable 0 = no effect. 1 = enables the spi to transfer and receive data.  spidis: spi disable 0 = no effect. 1 = disables the spi. all pins are set in input mode and no data is received or transmitted. if a transfer is in progress, the transfer is finished before the spi is disabled. if both spien and spidis are equal to one when the control register is written, the spi is disabled.  swrst: spi software reset 0 = no effect. 1 = resets the spi. a software-triggered hardware reset of the spi interface is performed. 0x20 sp_rpr receive pointer register read/write 0 0x24 sp_rcr receive counter register read/write 0 0x28 sp_tpr transmit pointer register read/write 0 0x2c sp_tcr transmit counter register read/write 0 0x30 sp_csr0 chip select register 0 read/write 0 0x34 ? reserved ?? 0x38 ? reserved ?? 0x3c ? reserved ?? 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ???????? 76543210 swrst ????? spidis spien table 27. spi memory map (continued) offset register name register access reset value
AT75C220 129 spi mode register register name: sp_mr access type: read/write reset value: 0x0  mstr: master/slave mode 0 = spi is in slave mode. 1 = spi is in master mode. mstr configures the spi interface for either master or slave mode operation.  ps: peripheral select 0 = fixed peripheral select 1 = variable peripheral select  pcsdec: chip select decode 0 = the chip selects are directly connected to a peripheral device. 1 = the four chip select lines are connected to a 4-to-16-bit decoder. when pcsdec equals one, up to one chip select signal can be generated with the four lines using an external 4-to-16-bit decoder. the chip select register defines the characteristics of the 16 chips selected according to the following rules: sp_csr0 defines peripheral chip select signals 0 to 3. sp_csr1 defines peripheral chip select signals 4 to 7. sp_csr2 defines peripheral chip select signals 8 to 11. sp_csr3 defines peripheral chip select signals 12 to 15.  mck32: clock selection 0 = spi master clock equals aclk. 1 = spi master clock equals aclk/32.  llb: local loopback enable 0 = local loopback path disabled. 1 = local loopback path enabled. llb controls the local loopback on the data serializer for testing in master mode only. 31 30 29 28 27 26 25 24 dlybcs 23 22 21 20 19 18 17 16 ???? pcs 15 14 13 12 11 10 9 8 ???????? 76543210 llb ??? mck32 pcsdec ps mstr
AT75C220 130  pcs: peripheral chip select this field is only used if fixed peripheral select is active (ps=0). if pcsdec=0: pcs = xxx0 npcs[3:0] = 1110 pcs = xx01 npcs[3:0] = 1101 pcs = x011 npcs[3:0] = 1011 pcs = 0111 npcs[3:0] = 0111 pcs = 1111 forbidden (no peripheral is selected) (x = don ? t care) if pcsdec=1: npcs[3:0] output signals = pcs  dlybcs: delay between chip selects this field defines the delay from npcs inactive to the activation of another npcs. the dlybcs time guarantees non- overlapping chip selects and solves bus contentions in case of peripherals with long data float times. if dlybcs equals zero, one spi master clock period will be inserted by default. otherwise, the following equation determines the delay: spi receive data register register name: sp_rdr access type: read-only reset value: 0x0  rd: receive data data received by the spi interface is stored in this register right-justified. unused bits read zero.  pcs: peripheral chip select status in master mode only, these bits indicate the value on the npcs pins at the end of a transfer. otherwise, these bits read as zero. npcs_to_spck_delay dlybcs spi_master_clock_period = 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???? pcs 15 14 13 12 11 10 9 8 rd 76543210 rd
AT75C220 131 spi transmit data register register name: sp_tdr access type: write-only reset value: ?  td: transmit data data that is to be transmitted by the spi interface is stored in this register. information to be transmitted must be written to the transmit data register in a right-justified format.  pcs: peripheral chip select this field is only used if variable peripheral select is active (ps = 1). if pcsdec = 0: pcs = xxx0 npcs[3:0] = 1110 pcs = xx01 npcs[3:0] = 1101 pcs = x011 npcs[3:0] = 1011 pcs = 0111 npcs[3:0] = 0111 pcs = 1111 forbidden (no peripheral is selected) (x = don ? t care) if pcsdec = 1: npcs[3:0] output signals = pcs 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???? pcs 15 14 13 12 11 10 9 8 td 76543210 td
AT75C220 132 spi status register register name: sp_sr access type: read-only reset value: 0x0  rdrf: receive data register full 0 = no data has been received since the last read of sp_rdr. 1 = data has been received and the received data has been transferred from the serializer to sp_rdr since the last read of sp_rdr.  tdre: transmit data register empty 0 = data has been written to sp_tdr and not yet transferred to the serializer. 1 = the last data written in the transmit data register has been transferred to the serializer. tdre equals zero when the spi is disabled or at reset. the spi enable command sets this bit to one.  modf: mode fault error 0 = no mode fault has been detected since the last read of sp_sr. 1 = a mode fault occurred since the last read of the sp_sr.  ovres: overrun error status 0 = no overrun has been detected since the last read of sp_sr. 1 = an overrun has occurred since the last read of sp_sr. an overrun occurs when sp_rdr is loaded at least twice from the serializer since the last read of the sp_rdr.  spendtx: spi end of transmission 0 = no end of data transmission detected. 1 = end of data transmission detected.  spendrx: spi end of reception 0 = no end of data reception detected. 1 = end of data reception detected.  spiens: spi enable status 0 = spi is disabled. 1 = spi is enabled. 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ??????? spiens 15 14 13 12 11 10 9 8 ???????? 76543210 ?? spendrx spendtx ovres modf tdre rdrf
AT75C220 133 spi interrupt enable register register name: sp_ier access type: write-only  rdrf: receive data register full interrupt enable 0 = no effect. 1 = enables the receiver data register full interrupt.  tdre: spi transmit data register empty interrupt enable 0 = no effect. 1 = enables the transmit data register empty interrupt.  modf: mode fault error interrupt enable 0 = no effect. 1 = enables the mode fault interrupt.  ovres: overrun error interrupt enable 0 = no effect. 1 = enables the overrun error interrupt. 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ???????? 76543210 ???? ovres modf tdre rdrf
AT75C220 134 spi interrupt disable register register name: sp_idr access type: write-only  rdrf: receive data register full interrupt disable 0 = no effect. 1 = disables the receiver data register full interrupt.  tdre: transmit data register empty interrupt disable 0 = no effect. 1 = disables the transmit data register empty interrupt.  modf: mode fault error interrupt disable 0 = no effect. 1 = disables the mode fault error interrupt.  ovres: overrun error interrupt disable 0 = no effect. 1 = disables the overrun error interrupt. 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ???????? 76543210 ???? ovres modf tdre rdrf
AT75C220 135 spi interrupt mask register register name: sp_imr access type: read-only reset value: 0x0  rdrf: receive data register full interrupt mask 0 = receive data register full interrupt is disabled. 1 = receive data register full interrupt is enabled.  tdre: transmit data register empty interrupt mask 0 = transmit data register empty interrupt is disabled. 1 = transmit data register empty interrupt is enabled.  modf: mode fault error interrupt mask 0 = mode fault error interrupt is disabled. 1 = mode fault error interrupt is enabled.  ovres: overrun error interrupt mask 0 = overrun error interrupt is disabled. 1 = overrun error interrupt is enabled. a one in any of the bits unmasks the relative interrupt. 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ???????? 76543210 ???? ovres modf tdre rdrf
AT75C220 136 spi receive pointer register register name: sp_rpr access type: read/write reset value: 0x0  rxptr: receive pointer rxptr must be loaded with the address of the receive buffer. spi receive counter register register name: sp_cpr access type: read/write reset value: 0x0  rxctr: receive counter register rxctr must be loaded with the size of the receive buffer. 0 = stop peripheral data transfer 1 - 4294967295 = start peripheral data transfer if rdrf is active. 31 30 29 28 27 26 25 24 rxptr 23 22 21 20 19 18 17 16 rxptr 15 14 13 12 11 10 9 8 rxptr 76543210 rxptr 31 30 29 28 27 26 25 24 rxctr 23 22 21 20 19 18 17 16 rxctr 15 14 13 12 11 10 9 8 rxctr 76543210 rxctr
AT75C220 137 spi transmit pointer register register name: sp_tpr access type: read/write reset value: 0x0  txptr: transmit pointer register txptr must be loaded with the address of the transmit buffer. spi transmit counter register register name: sp_tcr access type: read/write reset value: 0x0  txctr: transmit counter register txctr must be loaded with the size of the receive buffer. 0 = stop peripheral data transfer 1 - 4294967295 = start peripheral data transfer if tdre is active. 31 30 29 28 27 26 25 24 txptr 23 22 21 20 19 18 17 16 txptr 15 14 13 12 11 10 9 8 txptr 76543210 txptr 31 30 29 28 27 26 25 24 txctr 23 22 21 20 19 18 17 16 txctr 15 14 13 12 11 10 9 8 txctr 76543210 txctr
AT75C220 138 spi chip select register register name: sp_csr0 access type: read/write reset value: 0x0  cpol: clock polarity 0 = the inactive state value of spck is logic level zero. 1 = the inactive state value of spck is logic level one. cpol is used to determine the inactive state value of the serial clock (spck). it is used with ncpha to produce a desired clock/data relationship between master and slave devices.  ncpha: clock phase 0 = data is changed on the leading edge of spck and captured on the following edge of spck. 1 = data is captured on the leading edge of spck and changed on the following edge of spck. ncpha determines which edge of spck causes data to change and which edge causes data to be captured. ncpha is used with cpol to produce a desired clock/data relationship between master and slave devices.  bits: bits per transfer the bits field determines the number of data bits transferred. reserved values should not be used. 31 30 29 28 27 26 25 24 dlybct 23 22 21 20 19 18 17 16 dlybs 15 14 13 12 11 10 9 8 scbr 76543210 bits ?? ncpha cpol bits[3:0] bits per transfer bits[3:0] bits per transfer 0000 8 1000 16 0001 9 1001 reserved 0010 10 1010 reserved 0011 11 1011 reserved 0100 12 1100 reserved 0101 13 1101 reserved 0110 14 1110 reserved 0111 15 1111 reserved
AT75C220 139  scbr: serial clock baud rate in master mode, the spi interface uses a modulus counter to derive the spck baud rate from the spi master clock (selected between aclk and aclk/32). the baud rate is selected by writing a value from 2 to 255 in the field scbr. the following equation determines the spck baud rate: giving scbr a value of zero or one disables the baud rate generator. spck is disabled and assumes its inactive state value. no serial transfers may occur. at reset, baud rate is disabled.  dlybs: delay before spck this field defines the delay from npcs valid to the first valid spck transition. when dlybs equals zero, the npcs valid to spck transition is 1/2 the spck clock period. otherwise, the following equation determines the delay:  dlybct: delay between consecutive transfers this field defines the delay between two consecutive transfers with the same peripheral without removing the chip select. the delay is always inserted after each transfer and before removing the chip select if needed. when dlybct equals zero, a delay of four spi master clock periods is inserted. otherwise, the following equation determines the delay: spck_baud_rate spi_master_clock_frequency 2scbr -------------------------------------------------------------------------------- - = npcs_to_spck_delay dlybs spi_master_clock_period = delay_after_transfer 32 dlybct spi_master_clock_period =
AT75C220 140 wd: watchdog timer the AT75C220 has an internal watchdog timer which can be used to prevent system lock-up if the software becomes trapped in a deadlock. in normal operation, the user reloads the watchdog at regular intervals before the timer overflow occurs. if an overflow does occur, the watchdog timer generates one or a combination of the following sig- nals depending on the parameters in wd_omr:  if rsten is set, an internal reset is generated (wd_reset as shown in figure 34).  if irqen is set, a pulse is generated on the signal wdirq which is connected to the advanced interrupt controller  if exten is set, a low level is driven on the nwdovf signal for a duration of eight aclk cycles. the watchdog timer has a 16-bit down counter. bits 12 - 15 of the value loaded when the watchdog is restarted are pro- grammable using the hpcv parameter in wd_cmr. four clock sources are available to the watchdog counter: aclk/8, aclk/32, aclk/128 or aclk/1024. the selection is made using the wdclks parameter in wd_cmr. this provides a programmable time-out period of 1.3 ms to 2.6 seconds with a 24 mhz system clock. all write accesses are protected by control access keys to help prevent corruption of the watchdog should an error condition occur. to update the contents of the mode and control registers, it is necessary to write the correct bit pat- tern to the control access key bits at the same time as the control bits are written (the same write access). figure 34. watchdog timer block diagram wd user interface wd base address: 0xff028000 offset register name register description access reset value 0x00 wd_omr overflow mode register read/write 0 0x04 wd_cmr clock mode register read/write 0 0x08 wd_cr control register write-only ? 0x0c wd_sr status register read-only 0 advanced peripheral bus (apb) wd_reset wdirq aclk/8 aclk/32 aclk/128 aclk/1024 control logic clock select 16-bit programmable down counter clk_cnt clear overflow nwdovf
AT75C220 141 wd overflow mode register name: wd_omr access: read/write reset value: 0  wden: watchdog enable 0 = watchdog is disabled and does not generate any signals. 1 = watchdog is enabled and generates enabled signals.  rsten: reset enable 0 = generation of an internal reset by the watchdog is disabled. 1 = when overflow occurs, the watchdog generates an internal reset.  irqen: interrupt enable 0 = generation of an interrupt by the watchdog is disabled. 1 = when overflow occurs, the watchdog generates an interrupt.  exten: external signal enable 0 = generation of a pulse on the pin nwdovf by the watchdog is disabled. 1 = when an overflow occurs, a pulse on the pin nwdovf is generated.  okey: overflow access key used only when writing wd_omr. okey is read as 0. 0x234 = write access in wd_omr is allowed. other value = write access in wd_omr is prohibited. 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 okey 76543210 okey exten irqen rsten wden
AT75C220 142 wd clock mode register name: wd_cmr access: read/write reset value: 0  wdclks: clock selection  hpcv: high preload counter value counter is preloaded when watchdog counter is restarted with bits 0 to 11 set (fff) and bits 12 to 15 equaling hpcv.  ckey: clock access key used only when writing wd_cmr. ckey is read as 0. 0x06e: write access in wd_cmr is allowed. other value: write access in wd_cmr is prohibited. wd control register name: wd_cr access: write-only  rstkey: restart key 0xc071 = watchdog counter is restarted. other value = no effect. 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ckey 76543210 ckey ? hpcv wdclks wdclks clock selected 00aclk/8 01aclk/32 1 0 aclk/128 1 1 aclk/1024 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 rstkey 76543210 rstkey
AT75C220 143 wd status register name: wd_sr access: read-only  wdovf: watchdog overflow 0 = no watchdog overflow. 1 = a watchdog overflow has occurred since the last restart of the watchdog counter or since internal or external reset. wd enabling sequence to enable the watchdog timer the sequence is as follows: 1. disable the watchdog by clearing the bit wden: write 0x2340 to wd_omr this step is unnecessary if the wd is already disabled (reset state). 2. initialize the wd clock mode register: write 0x373c to wd_cmr (hpcv = 15 and wdclks = mck/8) 3. restart the timer: write 0xc071 to wd_cr 4. enable the watchdog: write 0x2345 to wd_omr (interrupt enabled) 31 30 29 28 27 26 25 24 ???????? 23 22 21 20 19 18 17 16 ???????? 15 14 13 12 11 10 9 8 ???????? 76543210 ??????? wdovf
? atmel corporation 2001. atmel corporation makes no warranty for the use of its products, other than those expressly contained in the company ? s standard war- ranty which is detailed in atmel ? s terms and conditions located on the company ? s web site. the company assumes no responsibility for any errors which may appear in this document, reserves the right to change devices or specifications detailed herein at any tim e without notice, and does not make any commitment to update the information contained herein. no licenses to patents or other intellectu al prop- erty of atmel are granted by the company in connection with the sale of atmel products, expressly or by implication. atmel ? s products are not authorized for use as critical components in life support devices or systems. atmel headquarters atmel operations corporate headquarters 2325 orchard parkway san jose, ca 95131 tel (408) 441-0311 fax (408) 487-2600 europe atmel sarl route des arsenaux 41 casa postale 80 ch-1705 fribourg switzerland tel (41) 26-426-5555 fax (41) 26-426-5500 asia atmel asia, ltd. room 1219 chinachem golden plaza 77 mody road tsimhatsui east kowloon hong kong tel (852) 2721-9778 fax (852) 2722-1369 japan atmel japan k.k. 9f, tonetsu shinkawa bldg. 1-24-8 shinkawa chuo-ku, tokyo 104-0033 japan tel (81) 3-3523-3551 fax (81) 3-3523-7581 atmel colorado springs 1150 e. cheyenne mtn. blvd. colorado springs, co 80906 tel (719) 576-3300 fax (719) 540-1759 atmel irving 6431 longhorn drive irving, tx 75063 tel (972) 756-3000 fax (972) 756-3445 atmel rousset zone industrielle 13106 rousset cedex france tel (33) 4-4253-6000 fax (33) 4-4253-6001 atmel smart card ics scottish enterprise technology park east kilbride, scotland g75 0qr tel (44) 1355-803-000 fax (44) 1355-242-743 atmel grenoble avenue de rochepleine bp 123 38521 saint-egreve cedex france tel (33) 4-7658-3000 fax (33) 4-7658-3480 fax-on-demand north america: 1-(800) 292-8635 international: 1-(408) 441-0732 e-mail literature@atmel.com web site http://www.atmel.com bbs 1-(408) 436-4309 printed on recycled paper. 1396a ? 05/01/0m at m e l ? is the registered trademark of atmel corporation; siap is the trademark of atmel corporation. arm ? , arm7tdmi ? and thumb ? are trademarks of arm, ltd.; oakdspcore ? is the trademark of dsp group, inc. other terms and product names in this document may be trademarks of others.


▲Up To Search▲   

 
Price & Availability of AT75C220

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X